This repository was archived by the owner on Aug 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 7
7
"url" : " https://github.com/dominykas/allow-scripts.git"
8
8
},
9
9
"scripts" : {
10
- "test" : " lab -L -t 80 -m 5000"
10
+ "test" : " lab -L -t 83 -m 5000"
11
11
},
12
12
"bin" : {
13
13
"allow-scripts" : " ./bin/allow-scripts.js"
Original file line number Diff line number Diff line change
1
+ {
2
+ "private" : true ,
3
+ "name" : " @example/allowed-false" ,
4
+ "version" : " 0.0.0" ,
5
+ "dependencies" : {
6
+ "@example/with-install-script" : " *" ,
7
+ "@example/with-postinstall-script" : " *" ,
8
+ "@example/without-scripts" : " *"
9
+ },
10
+ "allowScripts" : {
11
+ "@example/with-install-script" : " 1.x.x" ,
12
+ "@example/with-postinstall-script" : " *"
13
+ }
14
+ }
Original file line number Diff line number Diff line change @@ -70,5 +70,20 @@ describe('allow-scripts', () => {
70
70
expect ( fixture . getActualResult ( ) ) . to . equal ( 'postinstall from with-postinstall-script' ) ;
71
71
expect ( fixture . getLog ( ) ) . to . contain ( 'skip node_modules/@example/with-install-script (because it is not allowed in package.json)' ) ;
72
72
} ) ;
73
+
74
+ it ( 'skips scripts which are outside of allowed semver range' , async ( ) => {
75
+
76
+ const fixture = Fixtures . setup ( 'allowed-semver' , [
77
+ 'with-install-script' ,
78
+ 'with-postinstall-script' ,
79
+ 'without-scripts'
80
+ ] ) ;
81
+
82
+ await Allow . run ( { } ) ;
83
+
84
+ expect ( fixture . getActualResult ( ) ) . not . to . contain ( 'with-install-script' ) ;
85
+ expect ( fixture . getActualResult ( ) ) . to . equal ( 'postinstall from with-postinstall-script' ) ;
86
+ expect ( fixture . getLog ( ) ) . to . contain ( 'skip node_modules/@example/with-install-script (because 0.0.0 is outside of allowed range: 1.x.x)' ) ;
87
+ } ) ;
73
88
} ) ;
74
89
} ) ;
You can’t perform that action at this time.
0 commit comments