File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ module.exports = class extends Generator {
30
30
this . prompt ( prompts ) . then ( ( props ) => {
31
31
this . props = props ;
32
32
33
- console . log ( props ) ;
34
33
done ( ) ;
35
34
} ) ;
36
35
}
Original file line number Diff line number Diff line change 13
13
" generators"
14
14
],
15
15
"scripts" : {
16
- "lint" : " eslint src/**/*.js" ,
17
- "start" : " node src/index.js"
16
+ "coverage" : " jest --colors --coverage" ,
17
+ "coveralls" : " npm run coverage && cat ./coverage/lcov.info | coveralls" ,
18
+ "jest" : " jest --colors --verbose" ,
19
+ "lint" : " eslint generators/**/*.js test/**/*.js" ,
20
+ "test" : " npm run lint && npm run jest"
18
21
},
19
22
"repository" : {
20
23
"type" : " git" ,
27
30
"yeoman-generator" : " 3.0.0"
28
31
},
29
32
"devDependencies" : {
33
+ "coveralls" : " 3.0.2" ,
30
34
"eslint" : " 5.0.1" ,
31
35
"eslint-config-prettier" : " 2.9.0" ,
32
36
"eslint-plugin-prettier" : " 2.6.2" ,
33
- "prettier" : " 1.13.7"
37
+ "jest" : " 23.3.0" ,
38
+ "prettier" : " 1.13.7" ,
39
+ "yeoman-assert" : " 3.1.1" ,
40
+ "yeoman-test" : " 1.8.0"
34
41
},
35
42
"license" : " MIT"
36
43
}
Original file line number Diff line number Diff line change
1
+ const assert = require ( 'yeoman-assert' ) ;
2
+ const path = require ( 'path' ) ;
3
+ const test = require ( 'yeoman-test' ) ;
4
+
5
+ const files = require ( '../generators/app/files' ) ;
6
+
7
+ describe ( 'Generator Tests' , ( ) => {
8
+ beforeAll ( ( done ) => {
9
+ test
10
+ . run ( path . join ( __dirname , '../generators/app' ) )
11
+ . withPrompts ( {
12
+ project : 'statik-project' ,
13
+ description : 'A statik project'
14
+ } )
15
+ . on ( 'end' , done ) ;
16
+ } ) ;
17
+
18
+ it ( 'should create a project' , ( done ) => {
19
+ files . forEach ( ( file ) => {
20
+ assert . file ( file . destination ) ;
21
+ } ) ;
22
+
23
+ done ( ) ;
24
+ } ) ;
25
+ } ) ;
You can’t perform that action at this time.
0 commit comments