File tree 3 files changed +9
-11
lines changed
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1
- import path from 'path' ;
2
1
import { git } from '@commitlint/test' ;
3
- import test from 'ava' ;
4
2
import execa from 'execa' ;
5
3
import stream from 'string-to-stream' ;
6
4
7
- const bin = path . join ( __dirname , './cli.js' ) ;
5
+ const bin = require . resolve ( './cli.js' ) ;
8
6
9
7
const cli = ( args , options ) => {
10
8
return ( input = '' ) => {
@@ -18,8 +16,9 @@ const cli = (args, options) => {
18
16
} ;
19
17
} ;
20
18
21
- test ( 'should print warning if stage is empty' , async t => {
19
+ test ( 'should print warning if stage is empty' , async ( ) => {
22
20
const cwd = await git . bootstrap ( ) ;
23
21
const actual = await cli ( [ ] , { cwd} ) ( 'foo: bar' ) ;
24
- t . true ( actual . stdout . includes ( 'Nothing to commit.' ) ) ;
22
+ expect ( actual . stdout ) . toContain ( 'Nothing to commit.' ) ;
23
+ expect ( actual . stderr ) . toBe ( '' ) ;
25
24
} ) ;
Original file line number Diff line number Diff line change 11
11
"scripts" : {
12
12
"commit" : " $npm_package_bin_commit" ,
13
13
"deps" : " dep-check" ,
14
- "pkg" : " pkg-check --skip-main" ,
15
- "test" : " ava -c 4 --verbose"
14
+ "pkg" : " pkg-check --skip-main"
16
15
},
17
16
"repository" : {
18
17
"type" : " git" ,
31
30
"devDependencies" : {
32
31
"@commitlint/test" : " 8.2.0" ,
33
32
"@commitlint/utils" : " ^8.3.4" ,
34
- "ava " : " 2.4.0 "
33
+ "string-to-stream " : " 3.0.1 "
35
34
},
36
35
"dependencies" : {
37
36
"@commitlint/prompt" : " ^8.3.5" ,
38
- "execa" : " 0.11.0" ,
39
- "string-to-stream" : " 3.0.1"
37
+ "execa" : " 0.11.0"
40
38
}
41
39
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module.exports = {
5
5
testMatch : [
6
6
'**/*.test.ts?(x)' ,
7
7
'**/@commitlint/read/src/*.test.js?(x)' ,
8
- '**/@commitlint/cli/src/*.test.js?(x)'
8
+ '**/@commitlint/cli/src/*.test.js?(x)' ,
9
+ '**/@commitlint/prompt-cli/*.test.js?(x)'
9
10
]
10
11
} ;
You can’t perform that action at this time.
0 commit comments