File tree Expand file tree Collapse file tree 3 files changed +15
-39
lines changed Expand file tree Collapse file tree 3 files changed +15
-39
lines changed Original file line number Diff line number Diff line change 1111 "commit" : " git-cz" ,
1212 "deps" : " dep-check" ,
1313 "pkg" : " pkg-check --skip-import" ,
14- "start" : " concurrently \" ava --watch --verbose\" \" yarn run watch\" " ,
15- "test" : " ava --verbose" ,
14+ "start" : " yarn run watch" ,
1615 "watch" : " babel src --out-dir lib --watch --source-maps"
1716 },
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- },
3617 "babel" : {
3718 "presets" : [
3819 " commitlint"
6344 "devDependencies" : {
6445 "@babel/cli" : " ^7.7.7" ,
6546 "@babel/core" : " ^7.7.7" ,
66- "@babel/register" : " ^7.7.7" ,
6747 "@commitlint/utils" : " ^8.3.4" ,
68- "ava" : " 2.4.0" ,
6948 "babel-preset-commitlint" : " ^8.2.0" ,
7049 "commitizen" : " 3.1.2" ,
71- "concurrently" : " 3.6.1" ,
7250 "cross-env" : " 6.0.3"
7351 },
7452 "dependencies" : {
Original file line number Diff line number Diff line change 1- import test from 'ava' ;
21import getPrompt from './get-prompt' ;
32
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' ) ;
65} ) ;
76
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' ) ;
1815} ) ;
1916
20- test ( 'returns input unaltered wihtout rules' , async t => {
17+ test ( 'returns input unaltered wihtout rules' , async ( ) => {
2118 const message = await getPrompt ( 'type' , {
2219 prompter : stub ( 'foobar' )
2320 } ) ;
2421
25- t . is ( message , 'foobar' ) ;
22+ expect ( message ) . toEqual ( 'foobar' ) ;
2623} ) ;
2724
2825function stub ( input = '' ) {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module.exports = {
88 '**/@commitlint/read/src/*.test.js?(x)' ,
99 '**/@commitlint/travis-cli/src/*.test.js?(x)' ,
1010 '**/@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)'
1213 ]
1314} ;
You can’t perform that action at this time.
0 commit comments