-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
Copy pathindex.js
40 lines (33 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const fs = require('fs');
const path = require('path');
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
module.exports = useTestFrameworkDetector({
description: 'Generates an initializer unit test.',
shouldTransformTypeScript: true,
init() {
this._super && this._super.init.apply(this, arguments);
maybePolyfillTypeScriptBlueprints(this);
},
fileMapTokens: function () {
return {
__root__() {
return 'tests';
},
__testType__() {
return 'unit';
},
};
},
locals: function (options) {
return {
friendlyTestName: ['Unit', 'Initializer', options.entity.name].join(' | '),
modulePrefix: modulePrefixForProject(options.project),
destroyAppExists: fs.existsSync(
path.join(this.project.root, '/tests/helpers/destroy-app.js')
),
};
},
});