Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dab574e

Browse filesBrowse files
TrottBethGriggs
authored andcommitted
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 <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
1 parent 2700909 commit dab574e
Copy full SHA for dab574e

File tree

Expand file treeCollapse file tree

3 files changed

+36
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+36
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/policy/manifest.js‎

Copy file name to clipboardExpand all lines: lib/internal/policy/manifest.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ class DependencyMapperInstance {
136136
if (!target) {
137137
throw new ERR_MANIFEST_INVALID_SPECIFIER(
138138
this.href,
139-
target +
140-
', pattern needs to have a single' +
141-
'trailing "*" in target');
139+
`${target}, pattern needs to have a single trailing "*" in target`
140+
);
142141
}
143142
const prefix = target[1];
144143
const suffix = target[2];
Collapse file
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"resources": {
3+
"./fhqwhgads.js": {
4+
"dependencies": {
5+
"**": true
6+
}
7+
}
8+
}
9+
}
Collapse file
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
7+
8+
common.requireNoPackageJSONAbove();
9+
10+
const assert = require('assert');
11+
const { spawnSync } = require('child_process');
12+
const fixtures = require('../common/fixtures.js');
13+
14+
const policyFilepath = fixtures.path('policy-manifest', 'invalid.json');
15+
16+
const result = spawnSync(process.execPath, [
17+
'--experimental-policy',
18+
policyFilepath,
19+
'./fhqwhgads.js',
20+
]);
21+
22+
assert.notStrictEqual(result.status, 0);
23+
const stderr = result.stderr.toString();
24+
assert.match(stderr, /ERR_MANIFEST_INVALID_SPECIFIER/);
25+
assert.match(stderr, /pattern needs to have a single trailing "\*"/);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.