summaryrefslogtreecommitdiff
path: root/test/parallel/test-policy-manifest.js
blob: a8494175f3e68fe8a7dcd7a5728d4c085db4f028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 "\*"/);