@@ -67,6 +67,15 @@ function sortScriptsWithNpmRunAll(script) {
6767
6868 return Object . keys ( sortPackageJson ( packageJson ) . scripts )
6969}
70+ function sortScriptsWithNpmRunAll2 ( script ) {
71+ const packageJson = {
72+ scripts : { z : 'z' , a : 'a' , maybeRunS : script } ,
73+ devDependencies : { 'npm-run-all2' : '^1.0.0' } ,
74+ }
75+
76+ return Object . keys ( sortPackageJson ( packageJson ) . scripts )
77+ }
78+
7079const sortedScripts = [ 'a' , 'maybeRunS' , 'z' ]
7180const unsortedScripts = [ 'z' , 'a' , 'maybeRunS' ]
7281for ( const { script, expected } of [
@@ -108,6 +117,10 @@ for (const { script, expected } of [
108117 test ( `command: '${ script } '` , ( t ) => {
109118 t . deepEqual ( sortScriptsWithNpmRunAll ( script ) , expected )
110119 } )
120+
121+ test ( `command: '${ script } ' with npm-run-all2` , ( t ) => {
122+ t . deepEqual ( sortScriptsWithNpmRunAll2 ( script ) , expected )
123+ } )
111124}
112125
113126for ( const field of [ 'scripts' , 'betterScripts' ] ) {
@@ -127,6 +140,16 @@ for (const field of ['scripts', 'betterScripts']) {
127140 } )
128141}
129142
143+ // npm-run-all2
144+ for ( const { script, expected } of [
145+ // Should NOT sort
146+ { script : 'npm-run-all2 -s "lint:*"' , expected : unsortedScripts } ,
147+ ] ) {
148+ test ( `command: '${ script } ' with npm-run-all2` , ( t ) => {
149+ t . deepEqual ( sortScriptsWithNpmRunAll2 ( script ) , expected )
150+ } )
151+ }
152+
130153for ( const field of [ 'scripts' , 'betterScripts' ] ) {
131154 test (
132155 `${ field } does not sort pre/post scripts with colon together` ,
0 commit comments