File tree 3 files changed +15
-39
lines changed
3 files changed +15
-39
lines changed Original file line number Diff line number Diff line change 11
11
"commit" : " git-cz" ,
12
12
"deps" : " dep-check" ,
13
13
"pkg" : " pkg-check --skip-import" ,
14
- "start" : " concurrently \" ava --watch --verbose\" \" yarn run watch\" " ,
15
- "test" : " ava --verbose" ,
14
+ "start" : " yarn run watch" ,
16
15
"watch" : " babel src --out-dir lib --watch --source-maps"
17
16
},
18
- "ava" : {
19
- "babel" : {
20
- "testOptions" : {
21
- "presets" : [
22
- " babel-preset-commitlint"
23
- ]
24
- }
25
- },
26
- "require" : [
27
- " @babel/register"
28
- ],
29
- "files" : [
30
- " src/**/*.test.js"
31
- ],
32
- "sources" : [
33
- " src/**/*.js"
34
- ]
35
- },
36
17
"babel" : {
37
18
"presets" : [
38
19
" commitlint"
63
44
"devDependencies" : {
64
45
"@babel/cli" : " ^7.7.7" ,
65
46
"@babel/core" : " ^7.7.7" ,
66
- "@babel/register" : " ^7.7.7" ,
67
47
"@commitlint/utils" : " ^8.3.4" ,
68
- "ava" : " 2.4.0" ,
69
48
"babel-preset-commitlint" : " ^8.2.0" ,
70
49
"commitizen" : " 3.1.2" ,
71
- "concurrently" : " 3.6.1" ,
72
50
"cross-env" : " 6.0.3"
73
51
},
74
52
"dependencies" : {
Original file line number Diff line number Diff line change 1
- import test from 'ava' ;
2
1
import getPrompt from './get-prompt' ;
3
2
4
- test ( 'throws without params' , t => {
5
- t . throws ( ( ) => getPrompt ( ) , / M i s s i n g p r o m p t e r f u n c t i o n / ) ;
3
+ test ( 'throws without params' , ( ) => {
4
+ expect ( ( ) => getPrompt ( ) ) . toThrow ( ' Missing prompter function' ) ;
6
5
} ) ;
7
6
8
- test ( 'throws with incompatible prompter' , t => {
9
- t . throws (
10
- ( ) =>
11
- getPrompt ( 'type' , {
12
- prompter ( ) {
13
- return { } ;
14
- }
15
- } ) ,
16
- / p r o m p t .r e m o v e A l l L i s t e n e r s /
17
- ) ;
7
+ test ( 'throws with incompatible prompter' , ( ) => {
8
+ expect ( ( ) =>
9
+ getPrompt ( 'type' , {
10
+ prompter ( ) {
11
+ return { } ;
12
+ }
13
+ } )
14
+ ) . toThrow ( 'prompt.removeAllListeners' ) ;
18
15
} ) ;
19
16
20
- test ( 'returns input unaltered wihtout rules' , async t => {
17
+ test ( 'returns input unaltered wihtout rules' , async ( ) => {
21
18
const message = await getPrompt ( 'type' , {
22
19
prompter : stub ( 'foobar' )
23
20
} ) ;
24
21
25
- t . is ( message , 'foobar' ) ;
22
+ expect ( message ) . toEqual ( 'foobar' ) ;
26
23
} ) ;
27
24
28
25
function stub ( input = '' ) {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module.exports = {
8
8
'**/@commitlint/read/src/*.test.js?(x)' ,
9
9
'**/@commitlint/travis-cli/src/*.test.js?(x)' ,
10
10
'**/@commitlint/cli/src/*.test.js?(x)' ,
11
- '**/@commitlint/prompt-cli/*.test.js?(x)'
11
+ '**/@commitlint/prompt-cli/*.test.js?(x)' ,
12
+ '**/@commitlint/prompt/src/**/*.test.js?(x)'
12
13
]
13
14
} ;
You can’t perform that action at this time.
0 commit comments