forked from gooddata/gooddata-css-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
35 lines (29 loc) · 939 Bytes
/
Gruntfile.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
const jestCLI = require('jest-cli');
module.exports = (grunt) => {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-stylelint');
grunt.initConfig({
clean: {
test: ['test/tmp']
},
stylelint: {
test: {
options: {
outputFile: 'test/tmp/output/report.txt',
configFile: '.stylelintrc',
failOnError: false
},
src: 'test/output/output.{css,scss}'
}
}
});
grunt.registerTask('jest', () => {
const currentTask = grunt.task.current;
const done = currentTask.async();
jestCLI.runCLI(currentTask.options(), process.cwd(), (result) => {
done(result.success);
});
});
grunt.registerTask('test', ['clean:test', 'stylelint', 'jest']);
grunt.registerTask('default', 'test');
};