-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
policy: fix message for invalid manifest specifier
Add test for invalid manifest specifier and fix the error message which is missing a space ("singletrailing" instead of "single trailing"). PR-URL: #40574 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Voltrex <[email protected]>
- Loading branch information
1 parent
2700909
commit dab574e
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"resources": { | ||
"./fhqwhgads.js": { | ||
"dependencies": { | ||
"**": true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
|
||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
common.requireNoPackageJSONAbove(); | ||
|
||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
const fixtures = require('../common/fixtures.js'); | ||
|
||
const policyFilepath = fixtures.path('policy-manifest', 'invalid.json'); | ||
|
||
const result = spawnSync(process.execPath, [ | ||
'--experimental-policy', | ||
policyFilepath, | ||
'./fhqwhgads.js', | ||
]); | ||
|
||
assert.notStrictEqual(result.status, 0); | ||
const stderr = result.stderr.toString(); | ||
assert.match(stderr, /ERR_MANIFEST_INVALID_SPECIFIER/); | ||
assert.match(stderr, /pattern needs to have a single trailing "\*"/); |