@@ -16,13 +16,13 @@ export async function assertHookContainsScript(hook, script) {
16
16
17
17
Given ( 'husky v5 is installed' , async function ( ) {
18
18
td
19
- . when ( this . execa . default ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) )
19
+ . when ( this . execa ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) )
20
20
. thenResolve ( { stdout : JSON . stringify ( { dependencies : { husky : { version : '5.0.0' } } } ) } ) ;
21
21
} ) ;
22
22
23
23
Given ( 'husky v4 is installed' , async function ( ) {
24
24
td
25
- . when ( this . execa . default ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) )
25
+ . when ( this . execa ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) )
26
26
. thenResolve ( { stdout : JSON . stringify ( { dependencies : { husky : { version : '4.5.6' } } } ) } ) ;
27
27
} ) ;
28
28
@@ -32,7 +32,7 @@ Given('husky is not installed', async function () {
32
32
error . stdout = JSON . stringify ( { } ) ;
33
33
error . command = 'npm ls husky --json' ;
34
34
35
- td . when ( this . execa . default ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) ) . thenReject ( error ) ;
35
+ td . when ( this . execa ( 'npm' , [ 'ls' , 'husky' , '--json' ] ) ) . thenReject ( error ) ;
36
36
} ) ;
37
37
38
38
Given ( 'husky config is in v4 format' , async function ( ) {
@@ -44,7 +44,7 @@ Given('husky config is in v5 format', async function () {
44
44
} ) ;
45
45
46
46
Then ( 'husky is configured for a {string} project' , async function ( packageManager ) {
47
- td . verify ( this . execa . default ( td . matchers . contains ( / ( n p m i n s t a l l | y a r n a d d ) .* h u s k y / ) ) , { ignoreExtraArgs : true } ) ;
47
+ td . verify ( this . execa ( td . matchers . contains ( / ( n p m i n s t a l l | y a r n a d d ) .* h u s k y / ) ) , { ignoreExtraArgs : true } ) ;
48
48
49
49
await assertHookContainsScript ( 'pre-commit' , `${ packageManager } test` ) ;
50
50
await assertHookContainsScript ( 'commit-msg' , 'npx --no-install commitlint --edit $1' ) ;
@@ -53,17 +53,17 @@ Then('husky is configured for a {string} project', async function (packageManage
53
53
Then ( 'husky is configured for {string}' , async function ( packageManager ) {
54
54
if ( packageManagers . NPM === packageManager ) {
55
55
td . verify (
56
- this . execa . default ( td . matchers . contains ( '. ~/.nvm/nvm.sh && nvm use && npm install' ) ) ,
56
+ this . execa ( td . matchers . contains ( '. ~/.nvm/nvm.sh && nvm use && npm install' ) ) ,
57
57
{ ignoreExtraArgs : true }
58
58
) ;
59
59
}
60
60
if ( packageManagers . YARN === packageManager ) {
61
61
td . verify (
62
- this . execa . default ( td . matchers . contains ( '. ~/.nvm/nvm.sh && nvm use && yarn add' ) ) ,
62
+ this . execa ( td . matchers . contains ( '. ~/.nvm/nvm.sh && nvm use && yarn add' ) ) ,
63
63
{ ignoreExtraArgs : true }
64
64
) ;
65
65
}
66
- td . verify ( this . execa . default ( td . matchers . contains ( / ( n p m i n s t a l l | y a r n a d d ) .* h u s k y @ l a t e s t / ) ) , { ignoreExtraArgs : true } ) ;
66
+ td . verify ( this . execa ( td . matchers . contains ( / ( n p m i n s t a l l | y a r n a d d ) .* h u s k y @ l a t e s t / ) ) , { ignoreExtraArgs : true } ) ;
67
67
assert . equal (
68
68
JSON . parse ( await fs . readFile ( `${ process . cwd ( ) } /package.json` , 'utf-8' ) ) . scripts . prepare ,
69
69
'husky'
0 commit comments