-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
33 lines (31 loc) · 1.09 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
const BroccoliStyleLint = require('./src/broccoli-stylelint');
const TestGeneratorFactory = require('./src/test-generator-factory');
const concat = require('broccoli-concat');
module.exports = {
create (inputNode, options) {
let testGenerators;
if(!options.testGenerators){
testGenerators = TestGeneratorFactory.create(options.testingFramework || 'qunit');
} else {
testGenerators = options.testGenerators;
delete options.testGenerators;
}
if (!options.group) {
options.testGenerator = testGenerators.suite;
return new BroccoliStyleLint(inputNode, options);
} else {
options.testGenerator = testGenerators.test;
let resultTree = new BroccoliStyleLint(inputNode, options);
let header = testGenerators.suiteHeader('Stylelint');
let footer = testGenerators.suiteFooter();
return concat(resultTree, {
outputFile: `/${options.group}.stylelint-test.js`,
header,
inputFiles: ['**/*.stylelint-test.js'],
footer,
sourceMapConfig: { enabled: false },
allowNone: true,
});
}
}
};