@@ -9,7 +9,9 @@ common.requireNoPackageJSONAbove();
9
9
10
10
const assert = require ( 'assert' ) ;
11
11
const { spawnSync } = require ( 'child_process' ) ;
12
+ const { cpSync, rmSync } = require ( 'fs' ) ;
12
13
const fixtures = require ( '../common/fixtures.js' ) ;
14
+ const tmpdir = require ( '../common/tmpdir.js' ) ;
13
15
14
16
{
15
17
const policyFilepath = fixtures . path ( 'policy-manifest' , 'invalid.json' ) ;
@@ -25,6 +27,23 @@ const fixtures = require('../common/fixtures.js');
25
27
assert . match ( stderr , / p a t t e r n n e e d s t o h a v e a s i n g l e t r a i l i n g " \* " / ) ;
26
28
}
27
29
30
+ {
31
+ tmpdir . refresh ( ) ;
32
+ const policyFilepath = tmpdir . resolve ( 'file with % in its name.json' ) ;
33
+ cpSync ( fixtures . path ( 'policy-manifest' , 'invalid.json' ) , policyFilepath ) ;
34
+ const result = spawnSync ( process . execPath , [
35
+ '--experimental-policy' ,
36
+ policyFilepath ,
37
+ './fhqwhgads.js' ,
38
+ ] ) ;
39
+
40
+ assert . notStrictEqual ( result . status , 0 ) ;
41
+ const stderr = result . stderr . toString ( ) ;
42
+ assert . match ( stderr , / E R R _ M A N I F E S T _ I N V A L I D _ S P E C I F I E R / ) ;
43
+ assert . match ( stderr , / p a t t e r n n e e d s t o h a v e a s i n g l e t r a i l i n g " \* " / ) ;
44
+ rmSync ( policyFilepath ) ;
45
+ }
46
+
28
47
{
29
48
const policyFilepath = fixtures . path ( 'policy-manifest' , 'onerror-exit.json' ) ;
30
49
const result = spawnSync ( process . execPath , [
0 commit comments