test: add trailing commas in test/pummel

PR-URL: https://github.com/nodejs/node/pull/46610
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Antoine du Hamel 2023-02-12 17:36:39 +01:00 committed by GitHub
parent 09c1cbe65d
commit 873e5ce54a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 173 additions and 174 deletions

View File

@ -78,7 +78,6 @@ overrides:
- es-module/*.mjs
- parallel/*.js
- parallel/*.mjs
- pummel/*.js
- sequential/*.js
- sequential/*.mjs
rules:

View File

@ -108,7 +108,7 @@ const T_THRESHOLD = 3.892;
const t = getTValue(crypto.timingSafeEqual);
assert(
Math.abs(t) < T_THRESHOLD,
`timingSafeEqual should not leak information from its execution time (t=${t})`
`timingSafeEqual should not leak information from its execution time (t=${t})`,
);
// As a coherence check to make sure the statistical tests are working, run the
@ -118,5 +118,5 @@ const unsafeCompare = (bufA, bufB) => bufA.equals(bufB);
const t2 = getTValue(unsafeCompare);
assert(
Math.abs(t2) > T_THRESHOLD,
`Buffer#equals should leak information from its execution time (t=${t2})`
`Buffer#equals should leak information from its execution time (t=${t2})`,
);

View File

@ -54,6 +54,6 @@ for (let i = 0; i < 2000; i++) {
bSecret,
'Secrets should be equal.\n' +
`aSecret: ${aSecret.toString('base64')}\n` +
`bSecret: ${bSecret.toString('base64')}`
`bSecret: ${bSecret.toString('base64')}`,
);
}

View File

@ -18,7 +18,7 @@ tmpdir.refresh();
const file = path.join(tmpdir.path, 'toobig.txt');
const stream = fs.createWriteStream(file, {
flags: 'a'
flags: 'a',
});
stream.on('error', (err) => { throw err; });
@ -44,7 +44,7 @@ stream.on('finish', common.mustCall(function() {
message: 'Cannot create a string longer than ' +
`0x${stringLengthHex} characters`,
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
})(err);
}
assert.strictEqual(buf, undefined);

View File

@ -58,7 +58,7 @@ fs.writeFileSync(filepathOne, 'hello');
assert.throws(
() => { fs.watchFile(filepathOne); },
{ code: 'ERR_INVALID_ARG_TYPE' }
{ code: 'ERR_INVALID_ARG_TYPE' },
);
// Does not throw.
@ -78,7 +78,7 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
assert.throws(
() => { fs.watchFile(filepathTwo); },
{ code: 'ERR_INVALID_ARG_TYPE' }
{ code: 'ERR_INVALID_ARG_TYPE' },
);
{ // Does not throw.

View File

@ -14,6 +14,6 @@ validateSnapshotNodes('Node / ChannelWrap', [
// `Node / ChannelWrap` (C++) -> `ChannelWrap` (JS)
{ node_name: 'ChannelWrap', edge_name: 'native_to_javascript' },
],
detachedness: 2
detachedness: 2,
},
]);

View File

@ -18,7 +18,7 @@ validateSnapshotNodes('Node / Environment', [{
{ node_name: 'Node / CleanupQueue', edge_name: 'cleanup_queue' },
{ node_name: 'Node / IsolateData', edge_name: 'isolate_data' },
{ node_name: 'Node / Realm', edge_name: 'principal_realm' },
]
],
}]);
validateSnapshotNodes('Node / CleanupQueue', [
@ -28,14 +28,14 @@ validateSnapshotNodes('Node / CleanupQueue', [
{
children: [
{ node_name: 'Node / ContextifyScript' },
]
],
},
]);
validateSnapshotNodes('Node / Realm', [{
children: [
{ node_name: 'process', edge_name: 'process_object' },
]
],
}]);
console.log(context); // Make sure it's not GC'ed

View File

@ -11,6 +11,6 @@ validateSnapshotNodes('Node / FSReqPromise', [
children: [
{ node_name: 'FSReqPromise', edge_name: 'native_to_javascript' },
{ node_name: 'Float64Array', edge_name: 'stats_field_array' },
]
],
},
]);

View File

@ -29,7 +29,7 @@ server.listen(0, () => {
children: [
// current_headers and/or queue could be empty
{ node_name: 'Http2Stream', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });
@ -39,21 +39,21 @@ server.listen(0, () => {
children: [
{ node_name: 'FileHandle', edge_name: 'native_to_javascript' },
// current_headers could be empty
]
],
},
], { loose: true });
state.validateSnapshotNodes('Node / TCPSocketWrap', [
{
children: [
{ node_name: 'TCP', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });
state.validateSnapshotNodes('Node / TCPServerWrap', [
{
children: [
{ node_name: 'TCP', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });
// `Node / StreamPipe` (C++) -> StreamPipe (JS)
@ -61,7 +61,7 @@ server.listen(0, () => {
{
children: [
{ node_name: 'StreamPipe', edge_name: 'native_to_javascript' },
]
],
},
]);
// `Node / Http2Session` (C++) -> Http2Session (JS)
@ -71,11 +71,11 @@ server.listen(0, () => {
{ node_name: 'Http2Session', edge_name: 'native_to_javascript' },
{ node_name: 'Node / nghttp2_memory', edge_name: 'nghttp2_memory' },
{
node_name: 'Node / streams', edge_name: 'streams'
node_name: 'Node / streams', edge_name: 'streams',
},
// outstanding_pings, outgoing_buffers, outgoing_storage,
// pending_rst_streams could be empty
]
],
},
], { loose: true });
}));

View File

@ -10,7 +10,7 @@ const inspector = require('inspector');
const snapshotNode = {
children: [
{ node_name: 'Node / InspectorSession', edge_name: 'session' },
]
],
};
// Starts with no JSBindingsConnection (or 1 if coverage enabled).
@ -34,7 +34,7 @@ const snapshotNode = {
(edge) => edge.name === 'callback' &&
(edge.to.type === undefined || // embedded graph
edge.to.type === 'closure'), // snapshot
]
],
},
];
if (process.env.NODE_V8_COVERAGE) {

View File

@ -29,7 +29,7 @@ const server = net.createServer(common.mustCall((c) => {
// `Node / TLSWrap` (C++) -> `TLSWrap` (JS)
{ node_name: 'TLSWrap', edge_name: 'native_to_javascript' },
// pending_cleartext_input could be empty
]
],
},
]);
}));

View File

@ -10,7 +10,7 @@ validateSnapshotNodes('Node / MessagePort', [
{
children: [
{ node_name: 'Node / MessagePortData', edge_name: 'data' },
]
],
},
], { loose: true });
worker.terminate();

View File

@ -12,7 +12,7 @@ validateSnapshotNodes('Node / ZlibStream', [
children: [
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
// No entry for memory because zlib memory is initialized lazily.
]
],
},
]);
@ -22,7 +22,7 @@ gzip.write('hello world', common.mustCall(() => {
children: [
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
{ node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' },
]
],
},
]);
}));

View File

@ -8,7 +8,7 @@ const fixtures = require('../common/fixtures');
const fs = require('fs');
const env = {
...process.env,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};
if (!common.enoughTestMem)
@ -26,7 +26,7 @@ if (!common.enoughTestMem)
env: {
...env,
TEST_CHUNK: 2000,
}
},
});
const stderr = child.stderr.toString();
console.log(stderr);

View File

@ -16,7 +16,7 @@ const env = {
TEST_ALLOCATION: 50000,
TEST_CHUNK: 1000,
TEST_CLEAN_INTERVAL: 500,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};
{

View File

@ -98,7 +98,7 @@ const env = {
env: {
...env,
limit: 1,
limit2: 2
limit2: 2,
},
});
console.log(child.stdout.toString());

View File

@ -13,7 +13,7 @@ const fixtures = require('../common/fixtures');
const fs = require('fs');
const env = {
...process.env,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};
{

View File

@ -45,8 +45,8 @@ server.listen(0, function connect() {
port: server.address().port,
path: '/',
headers: {
'Connection': 'Keep-alive'
}
'Connection': 'Keep-alive',
},
}, function(res) {
res.on('end', function() {
if (++responses < expected) {

View File

@ -53,7 +53,7 @@ server.listen(0, function() {
const request = http.request({
port: server.address().port,
method: 'POST',
path: '/'
path: '/',
});
function ping() {

View File

@ -30,7 +30,7 @@ const https = require('https');
const options = {
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
cert: fixtures.readKey('agent1-cert.pem'),
};
process.stdout.write('build body...');
@ -46,7 +46,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) {
server.listen(0, common.mustCall(function() {
https.get({
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
}, common.mustCall(function(res) {
console.log('response!');

View File

@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures');
const options = {
key: fixtures.readKey('rsa_private.pem'),
cert: fixtures.readKey('rsa_cert.crt')
cert: fixtures.readKey('rsa_cert.crt'),
};
const buf = Buffer.allocUnsafe(1024 * 1024);
@ -47,7 +47,7 @@ server.listen(0, function() {
const req = https.request({
method: 'POST',
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
}, function(res) {
res.read(0);

View File

@ -37,7 +37,7 @@ const body = 'hello world\n';
const server = http.createServer((req, res) => {
res.writeHead(200, {
'Content-Length': body.length,
'Content-Type': 'text/plain'
'Content-Type': 'text/plain',
});
res.write(body);
res.end();
@ -108,17 +108,17 @@ process.on('exit', () => {
assert.strictEqual(
normalReqSec > 50,
true,
`normalReqSec should be greater than 50, but got ${normalReqSec}`
`normalReqSec should be greater than 50, but got ${normalReqSec}`,
);
assert.strictEqual(
keepAliveReqSec > 50,
true,
`keepAliveReqSec should be greater than 50, but got ${keepAliveReqSec}`
`keepAliveReqSec should be greater than 50, but got ${keepAliveReqSec}`,
);
assert.strictEqual(
normalReqSec < keepAliveReqSec,
true,
'normalReqSec should be less than keepAliveReqSec, ' +
`but ${normalReqSec} is greater than ${keepAliveReqSec}`
`but ${normalReqSec} is greater than ${keepAliveReqSec}`,
);
});

View File

@ -46,7 +46,7 @@ const server = net.createServer((connection) => {
assert.ok(connection.bufferSize >= 0, `bufferSize: ${connection.bufferSize}`);
assert.ok(
connection.writableLength <= totalLength,
`writableLength: ${connection.writableLength}, totalLength: ${totalLength}`
`writableLength: ${connection.writableLength}, totalLength: ${totalLength}`,
);
connection.end();
});

View File

@ -93,11 +93,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -108,7 +108,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -165,11 +165,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -189,7 +189,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -205,7 +205,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -254,11 +254,11 @@ for (const permutation of permutations({
permutation.packageType === 'module' ? 'module' : 'commonjs';
const parentFormat = fileExtensionFormat(
permutation.parentExtension,
effectivePackageType
effectivePackageType,
);
const depFormat = fileExtensionFormat(
permutation.depExtension,
effectivePackageType
effectivePackageType,
);
// non-sensical attempt to require ESM
if (depFormat === 'module' && parentFormat === 'commonjs') {
@ -354,7 +354,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -94,11 +94,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
const cliPolicy = willDeletePolicy ? tmpPolicyPath : policyPath;
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -109,7 +109,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -166,11 +166,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -189,7 +189,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -205,7 +205,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -341,7 +341,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -94,11 +94,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
const cliPolicy = willDeletePolicy ? tmpPolicyPath : policyPath;
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -109,7 +109,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -166,11 +166,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -189,7 +189,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -205,7 +205,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -341,7 +341,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -94,11 +94,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
const cliPolicy = willDeletePolicy ? tmpPolicyPath : policyPath;
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -109,7 +109,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -166,11 +166,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -189,7 +189,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -205,7 +205,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -313,7 +313,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -111,11 +111,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -126,7 +126,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -183,11 +183,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -206,7 +206,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -222,7 +222,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -364,7 +364,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -111,11 +111,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -126,7 +126,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -183,11 +183,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -206,7 +206,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -222,7 +222,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -362,7 +362,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -111,11 +111,11 @@ function drainQueue() {
const testId = newTestId();
const configDirPath = path.join(
tmpdir.path,
`test-policy-integrity-permutation-${testId}`
`test-policy-integrity-permutation-${testId}`,
);
const tmpPolicyPath = path.join(
tmpdir.path,
`deletable-policy-${testId}.json`
`deletable-policy-${testId}.json`,
);
fs.rmSync(configDirPath, { maxRetries: 3, recursive: true, force: true });
@ -126,7 +126,7 @@ function drainQueue() {
};
const manifestPath = path.join(configDirPath, policyPath);
for (const [resourcePath, { body, integrities }] of Object.entries(
resources
resources,
)) {
const filePath = path.join(configDirPath, resourcePath);
if (integrities !== null) {
@ -183,11 +183,11 @@ function drainQueue() {
console.log(
'permutation',
testId,
'failed'
'failed',
);
console.dir(
{ config, manifest },
{ depth: null }
{ depth: null },
);
console.log('exit code:', status, 'signal:', signal);
console.log(`stdout: ${Buffer.concat(stdout)}`);
@ -206,7 +206,7 @@ function drainQueue() {
['--experimental-policy', policyPath, '--experimental-policy', policyPath],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow multiple policies');
}
@ -222,7 +222,7 @@ function drainQueue() {
['--experimental-policy', enoentFilepath, '-e', ''],
{
stdio: 'pipe',
}
},
);
assert.notStrictEqual(status, 0, 'Should not allow missing policies');
}
@ -334,7 +334,7 @@ for (const permutation of permutations({
parentPath,
depPath,
resources,
})
}),
);
}
debug(`spawning ${tests.size} policy integrity permutations`);

View File

@ -78,7 +78,7 @@ function makeRequest() {
const serverOptions = {
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
cert: fixtures.readKey('agent1-cert.pem'),
};
let uploadCount = 0;

View File

@ -33,7 +33,7 @@ const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb
const options = {
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
cert: fixtures.readKey('agent1-cert.pem'),
};
class Mediator extends stream.Writable {
@ -62,7 +62,7 @@ const server = tls.Server(options, common.mustCall(function(socket) {
server.listen(0, common.mustCall(() => {
const client1 = tls.connect({
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
}, common.mustCall(function() {
client1.end(request);
}));

View File

@ -37,7 +37,7 @@ process.stdout.write('done\n');
const options = {
key: fixtures.readKey('agent2-key.pem'),
cert: fixtures.readKey('agent2-cert.pem')
cert: fixtures.readKey('agent2-cert.pem'),
};
const server = tls.Server(options, common.mustCall(function(socket) {
@ -49,7 +49,7 @@ let recvCount = 0;
server.listen(0, function() {
const client = tls.connect({
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
});
client.on('data', function(d) {

View File

@ -9,7 +9,7 @@ const vm = require('vm');
const sandbox = { timeout: 5 };
const context = vm.createContext(sandbox);
const script = new vm.Script(
'var d = Date.now() + timeout;while (d > Date.now());'
'var d = Date.now() + timeout;while (d > Date.now());',
);
const immediate = setImmediate(function() {
throw new Error('Detected vm race condition!');

View File

@ -37,13 +37,13 @@ const kPasswords = {
long: '55736572732073686f756c64207069636b206c6f6' +
'e6720706173737068726173657320286e6f742075' +
'73652073686f72742070617373776f7264732921',
empty: ''
empty: '',
};
const kSalts = {
short: '4e61436c',
long: '536f6469756d2043686c6f7269646520636f6d706f756e64',
empty: ''
empty: '',
};
const kDerivations = {
@ -55,7 +55,7 @@ const kDerivations = {
'1000': 'aaec5a976d4d35cb2024486fc9f9bb9aa' +
'3eae7cef2bce62664b5b3751cf50ff1',
'100000': '6f5ea3c6c6f5e4833467b47c3a671e6' +
'5714e87071bd1e36d716f846b5cd28980'
'5714e87071bd1e36d716f846b5cd28980',
},
'SHA-512': {
'1': '69f4d5cef5c7d8ba938e880388c8f63b6b2' +
@ -63,7 +63,7 @@ const kDerivations = {
'1000': '865c5945e11f5bf3ddf002e7cb1748f6' +
'224d2671e806dad4aaf090a04367da29',
'100000': '483ba7f2e2fe382cf61d20b29812e2' +
'd49610a60041ae40ecf9fc7ef138e93876'
'd49610a60041ae40ecf9fc7ef138e93876',
},
'SHA-1': {
'1': '4624dbd21373ee5659c125b184eedaa26a3' +
@ -71,7 +71,7 @@ const kDerivations = {
'1000': '5388ea5e62e1b557981abe5ce4132127' +
'58aa6a9d2c5bf08c019d459dba666b90',
'100000': 'f58f435fbc5c05865c914fd972108a' +
'09457d5f9a48f14e75e4cc02d98983038a'
'09457d5f9a48f14e75e4cc02d98983038a',
},
'SHA-256': {
'1': 'c6bc55a404adcea36a1ab56798085e0aaf6' +
@ -79,8 +79,8 @@ const kDerivations = {
'1000': '4e6ca57957439be3a75370424225e221' +
'1d55f05af00561df3f3efee9116bc34c',
'100000': 'ab25796598e74b29c324f5ba4d90ea' +
'7dc89fc6891041b4d56c94156505f722c0'
}
'7dc89fc6891041b4d56c94156505f722c0',
},
},
long: {
'SHA-384': {
@ -89,7 +89,7 @@ const kDerivations = {
'1000': 'a310ef3c6b3a95e6d8ca6644e3dcfd88' +
'222a59fe8e00c52d6a12631d82c1d24b',
'100000': '2c8c6674c879cf1850bc9b7fbdcc6e' +
'a7abb0a1522196a866875305dea57486f3'
'a7abb0a1522196a866875305dea57486f3',
},
'SHA-512': {
'1': '5777027aff4051fb9b43c1f1ef0463bd677' +
@ -97,7 +97,7 @@ const kDerivations = {
'1000': '9c17fe96895eadbfd1cc095fc1bb834f' +
'28e5ccc9ec96ca814cff941a4bf40727',
'100000': 'b479c9715c421638dce0a705fc0b7b' +
'a7d56fa3063188063580e070dff1db497c'
'a7d56fa3063188063580e070dff1db497c',
},
'SHA-1': {
'1': '576f7c165825bef9ef14b4bc2c82469d1e4' +
@ -105,7 +105,7 @@ const kDerivations = {
'1000': '89d3b27b5f6e8af015f2f87cf368a143' +
'8a206c4ecf5fe681fc3bf94c56213ef6',
'100000': '1e39e8bf6676fcd3156655457afa14' +
'bee771dbcbfcd07241c7cee209a7cb1fe9'
'bee771dbcbfcd07241c7cee209a7cb1fe9',
},
'SHA-256': {
'1': '12b90f594f0908cf912d655c948f9c2a1ea' +
@ -113,8 +113,8 @@ const kDerivations = {
'1000': 'b1a7b7dc20df174a4a0e410dbfaf03b4' +
'c375c450a89d7a9ed349b4e52e64dfd8',
'100000': 'd4594d8a1b59520a48878922a65d66' +
'3d28f6a5fa49e931d300d8f9baf93d0aeb'
}
'3d28f6a5fa49e931d300d8f9baf93d0aeb',
},
},
empty: {
'SHA-384': {
@ -123,7 +123,7 @@ const kDerivations = {
'1000': 'aeb5f97d6627eebcde6b139a00895500' +
'30f7401c67e01c057a3338175e3f3a17',
'100000': 'd7687df6c781dc88d64ef9cbaf95d3' +
'd5d1155f66b230239e6e81c1550c8840cf'
'd5d1155f66b230239e6e81c1550c8840cf',
},
'SHA-512': {
'1': '8f7b7d459c752f64bf12be625b65d496ac2' +
@ -131,7 +131,7 @@ const kDerivations = {
'1000': 'b5ac720b7abe0832fc51a31b1ec5673b' +
'eb1e41840adfd3d606e8638f4006eb48',
'100000': 'ba1a0f36bad771526564051eb9ca20' +
'7da19b62e53762349976a9a3d1b0ef7e20'
'7da19b62e53762349976a9a3d1b0ef7e20',
},
'SHA-1': {
'1': 'c0cffb0ce5db351faa24dad5902583cfc30' +
@ -139,7 +139,7 @@ const kDerivations = {
'1000': '736f3c3d6ebcc2a7b970403e2696c0eb' +
'4cd1770f55f196fc7089e666c11f77da',
'100000': '1c5095ac9a7bd410ef0f72c993eca9' +
'1bb0e571e9b2fbab704f8c131191fad16c'
'1bb0e571e9b2fbab704f8c131191fad16c',
},
'SHA-256': {
'1': '019e54ab42f00485d3aa1b26fcde21ae5f5' +
@ -147,9 +147,9 @@ const kDerivations = {
'1000': 'b9d2f2217b4ee5a8bf0345f36b2c9887' +
'33f503a975dfeac7b7135f54a5f29971',
'100000': 'a7a2869829797807b3e576c17878b4' +
'66449e89e60447d541775a96eb7c1a5ded'
}
}
'66449e89e60447d541775a96eb7c1a5ded',
},
},
},
long: {
short: {
@ -159,7 +159,7 @@ const kDerivations = {
'1000': 'faa442fbabf4058cc65368b53d7ec511' +
'3c09ea7e5e3743312f4bebedd980ba37',
'100000': 'f62ae6c7871b181aa71232f5eb8837' +
'2498ef32ac0a7d715119e8f052eb102d29'
'2498ef32ac0a7d715119e8f052eb102d29',
},
'SHA-512': {
'1': '3e9c12b3f6dfb6441594ec7063fca962ffd' +
@ -167,7 +167,7 @@ const kDerivations = {
'1000': 'f0928f50a155f26a8c9c1bc7f3b5cb53' +
'1c53a8f51040c9ce5fc79d430ff0c0f4',
'100000': '974acfbb0f0f20c81ec92829f38c3d' +
'af086a7df58b912b856d1f5ecc9355ef1b'
'af086a7df58b912b856d1f5ecc9355ef1b',
},
'SHA-1': {
'1': '8ae72f94e6fcd54fcbfca66200a211a51b2' +
@ -175,7 +175,7 @@ const kDerivations = {
'1000': '53b42161134e15c871abd71aba1390d0' +
'1f4c6a940caaf5c179258d8f1b1d680b',
'100000': 'a7fda4c79dd3ba1a875f65e9248b21' +
'0899ca0814ae38995d8ce5a53560cbac31'
'0899ca0814ae38995d8ce5a53560cbac31',
},
'SHA-256': {
'1': 'ffa1e9a727a92c27ae6f74b1c7978f9e1af' +
@ -183,8 +183,8 @@ const kDerivations = {
'1000': 'eeeb7714420a00b18acec2b5979d1da6' +
'1373202b7f8ba71b086293aab859e0a0',
'100000': 'deac70cbe3f1720e353b4e8016ddb5' +
'9475efb70b6a2385e735d2d6ea6d624a4d'
}
'9475efb70b6a2385e735d2d6ea6d624a4d',
},
},
long: {
'SHA-384': {
@ -193,7 +193,7 @@ const kDerivations = {
'1000': '35658551f0ec13398a7b45e0261cfd65' +
'4c1e52411e6e457dee68f4aeabe925a7',
'100000': '1abab5f1e461df378b88c0a22be76e' +
'f2f1627df74ac7cbfb84bdccb354bc8889'
'f2f1627df74ac7cbfb84bdccb354bc8889',
},
'SHA-512': {
'1': 'de4afbc0add3e4d32f4bc6e122a88ae44a2' +
@ -201,7 +201,7 @@ const kDerivations = {
'1000': '43e12024c4d354727f7e58842ccb6033' +
'a161d60dc5ae516f076e4a58a1880d38',
'100000': 'f9a92384a4eadfc3560649b37fb676' +
'e83c453cbbd99f80bba6f0a10ebd150b52'
'e83c453cbbd99f80bba6f0a10ebd150b52',
},
'SHA-1': {
'1': '1d104ea5d235006a12a80f71b80ee528048' +
@ -209,7 +209,7 @@ const kDerivations = {
'1000': '6e90c86ee07b873e965071025673ff05' +
'429f678c30f91b37e1e2da512036d320',
'100000': '141030763bf983c8564d5d4c935fe3' +
'ca3549608159ac1934c1599040668c2363'
'ca3549608159ac1934c1599040668c2363',
},
'SHA-256': {
'1': 'fd5caeb8b3abe589bc159c4e51f800570e7' +
@ -217,8 +217,8 @@ const kDerivations = {
'1000': '3fd587c94ba946b8b9dccddd2a5b74f6' +
'778d4f61e691f83ac47a2fa9580bfdf8',
'100000': '11992d8b813311244c544b62292945' +
'e208d403cebd6b9552a1a562065d9958ea'
}
'e208d403cebd6b9552a1a562065d9958ea',
},
},
empty: {
'SHA-384': {
@ -227,7 +227,7 @@ const kDerivations = {
'1000': 'f9ca148b0c041890bff8831db6174719' +
'7e94ce68f190edf269694b4d644861ca',
'100000': '1749dfcd77e5258519ea2231ba2cd6' +
'543b073339ac9b1545bb643153faf6d17b'
'543b073339ac9b1545bb643153faf6d17b',
},
'SHA-512': {
'1': 'd1bfa1a6b8a977839f8c3f9d52dd02104e2' +
@ -235,7 +235,7 @@ const kDerivations = {
'1000': '457a7955ebecec71a51efb6237e5b1d6' +
'2f4deab5c93d7b3d11d1e70faffa417e',
'100000': 'e805ac9cc1d8412c42446d237d1b50' +
'4f9540b362bd1b75e451531e853e24753d'
'4f9540b362bd1b75e451531e853e24753d',
},
'SHA-1': {
'1': 'a46a62986d9c3909f41014dd72cfe34a261' +
@ -243,7 +243,7 @@ const kDerivations = {
'1000': 'e7375de5036766c40cb85f43b53fce4f' +
'fa402ab6be3571007ef5d55453fd7f0a',
'100000': '7a403d9a13aed8164e9c072c545462' +
'251fd942f1736a6bf03ce1c88330048e04'
'251fd942f1736a6bf03ce1c88330048e04',
},
'SHA-256': {
'1': '4f510c5181ac5c2c5fd4bd141f9712495be' +
@ -251,9 +251,9 @@ const kDerivations = {
'1000': '7e66c84bea888f92c348d9145585186c' +
'ae472b12fba7f0ad28179575c1aa815a',
'100000': '5f1a6ac4a56d9796a7309a78daaaf9' +
'18badaf5ed1eecc3f0b8a3a44c3d38d654'
}
}
'18badaf5ed1eecc3f0b8a3a44c3d38d654',
},
},
},
empty: {
short: {
@ -263,7 +263,7 @@ const kDerivations = {
'1000': '7ff7954aeddf41795fc8300666786d49' +
'74269aa91cc7e93811c953331d56d609',
'100000': '1c73132b6a55e9d9de2cdbfe1f55bf' +
'0ab59fd91f78f109c50096038b8557b147'
'0ab59fd91f78f109c50096038b8557b147',
},
'SHA-512': {
'1': 'e7e2b41f4887421bcb764eb4a56f63d2502' +
@ -271,7 +271,7 @@ const kDerivations = {
'1000': 'd561c4c84e9c60ba4752a2d383bf55ef' +
'f643fc9e452252d6821e39449350cf72',
'100000': 'efd00752bc9ffafb5a399dd1d5834e' +
'8d2c2b676ecd4b2063fb1fe581d0f1380b'
'8d2c2b676ecd4b2063fb1fe581d0f1380b',
},
'SHA-1': {
'1': 'a667da47b8f857b7c65f70a6c8e7a06ce0d' +
@ -279,7 +279,7 @@ const kDerivations = {
'1000': '72c92bbd3ddab4789e88e42ad1cda83c' +
'c0729e6cb5106a577e50d5cf61782481',
'100000': '06e19e1b83e6480b1554df2b31a2c9' +
'2d1bfcf9bc1bdbc8751ff8685bdeef7dc9'
'2d1bfcf9bc1bdbc8751ff8685bdeef7dc9',
},
'SHA-256': {
'1': '2ddb49243eb3b5912cb260cdd87fb04ef0d' +
@ -287,8 +287,8 @@ const kDerivations = {
'1000': '2835f3ed53565420c90951509b0c1173' +
'b645174f1546ab3ac3e6c85cb471b53b',
'100000': '80aed905ca32ae0bb2a9d8f532f048' +
'a0e672463eef9f83dfa7d88bca726553ea'
}
'a0e672463eef9f83dfa7d88bca726553ea',
},
},
long: {
'SHA-384': {
@ -297,7 +297,7 @@ const kDerivations = {
'1000': '8bb89cf71972fe5acc16fdc5f8cffd2c2' +
'e7178c086b3bbe61cc1314619135958',
'100000': '26c6a8ae4bd1fbe715ae478efff3eca' +
'e83afa617ed35bd4a3f63c3da76a42d22'
'e83afa617ed35bd4a3f63c3da76a42d22',
},
'SHA-512': {
'1': 'bb73f8168a8f391d3d54ca892fb72b8e603' +
@ -305,7 +305,7 @@ const kDerivations = {
'1000': '5cacc16cdfbe052cfd73a9891b8c0e78' +
'b19b2e07eae2423d48fed5e08aa8494b',
'100000': '87fdfc293392cbf33ecc9b5141a2fe' +
'fa74d150499756863c484c0a78b6274d7f'
'fa74d150499756863c484c0a78b6274d7f',
},
'SHA-1': {
'1': '1f46b40cf2fb3dc41a3d9ced8897b861050' +
@ -313,7 +313,7 @@ const kDerivations = {
'1000': 'cc5748ecc41288a0e13368543aaa2ef6' +
'2c97ba7518fa88f6e11c35763fc930b4',
'100000': '33e2993bf4729dc993fff66e69cc55' +
'777135ebfabce533575bce4a96645a742c'
'777135ebfabce533575bce4a96645a742c',
},
'SHA-256': {
'1': '61c935c462c3321c89663545d13a4f6b52b' +
@ -321,8 +321,8 @@ const kDerivations = {
'1000': '1353f7458237ab332ee052e29f829a2a' +
'b90e72630ea10493b4eecffb9ff89e1d',
'100000': '79baf80ec582920538801e9d929ce0' +
'7084277987488d733a026852c452f06fb4'
}
'7084277987488d733a026852c452f06fb4',
},
},
empty: {
'SHA-384': {
@ -331,7 +331,7 @@ const kDerivations = {
'1000': '9cbfe72d194da34e17c821dd1569ef50' +
'a86eb4d893591776adc6a5c21e0031cf',
'100000': 'ed6bd7282567abe48d542d067d09f4' +
'04bd044ae2cefe11dacc531c4764cd35cd'
'04bd044ae2cefe11dacc531c4764cd35cd',
},
'SHA-512': {
'1': '6d2ecbbbfb2e6dcd7056faf9af6aa06eae5' +
@ -339,7 +339,7 @@ const kDerivations = {
'1000': 'cb93096c3a02beeb1c5fac36765c9011' +
'fe99f8d8ea62366048fc98cb98dfea8f',
'100000': '89e16254ebad5cba72e0aebe1614c7' +
'f9b795a7505f2637206ce10a3449a2b8bb'
'f9b795a7505f2637206ce10a3449a2b8bb',
},
'SHA-1': {
'1': '1e437a1c79d75be61e91141dae20affc489' +
@ -347,7 +347,7 @@ const kDerivations = {
'1000': '6e40910ac02ec89cebb9d898b13a09d1' +
'cd7adf6f8cc08cc473302c8973aa2e19',
'100000': 'a9e1bebb36bc26d7c997d5483cbc8d' +
'e4a419d1e706571342632586ec330a7290'
'e4a419d1e706571342632586ec330a7290',
},
'SHA-256': {
'1': 'f7ce0b653d2d72a4108cf5abe912ffdd777' +
@ -355,10 +355,10 @@ const kDerivations = {
'1000': '4fc58a21c100ce1835b8f9991d738b56' +
'965d14b24e1761fbdffc69ac5e0b667a',
'100000': '64a868d4b23af696d3734d0b814d04' +
'cdd1ac280128e97653a05f32b49c13a29a'
}
}
}
'cdd1ac280128e97653a05f32b49c13a29a',
},
},
},
};
async function setupBaseKeys() {
@ -420,7 +420,7 @@ async function testDeriveBits(
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
hash,
iterations
iterations,
};
const bits = await subtle.deriveBits(algorithm, baseKeys[size], 256);
@ -441,7 +441,7 @@ async function testDeriveBitsBadLengths(
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
iterations,
hash
hash,
};
return Promise.all([
@ -481,7 +481,7 @@ async function testDeriveBitsBadHash(
subtle.deriveBits(
{
...algorithm,
hash: hash.substring(0, 3) + hash.substring(4)
hash: hash.substring(0, 3) + hash.substring(4),
}, baseKeys[size], 256), {
message: /Unrecognized algorithm name/,
name: 'NotSupportedError',
@ -490,7 +490,7 @@ async function testDeriveBitsBadHash(
subtle.deriveBits(
{
...algorithm,
hash: 'HKDF'
hash: 'HKDF',
},
baseKeys[size], 256), {
message: /Unrecognized algorithm name/,
@ -509,12 +509,12 @@ async function testDeriveBitsBadUsage(
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
iterations,
hash
hash,
};
return assert.rejects(
subtle.deriveBits(algorithm, noBits[size], 256), {
message: /baseKey does not have deriveBits usage/
message: /baseKey does not have deriveBits usage/,
});
}
@ -531,7 +531,7 @@ async function testDeriveKey(
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
hash,
iterations
iterations,
};
const key = await subtle.deriveKey(
@ -565,7 +565,7 @@ async function testDeriveKeyBadHash(
subtle.deriveKey(
{
...algorithm,
hash: hash.substring(0, 3) + hash.substring(4)
hash: hash.substring(0, 3) + hash.substring(4),
},
baseKeys[size],
keyType,
@ -579,7 +579,7 @@ async function testDeriveKeyBadHash(
subtle.deriveKey(
{
...algorithm,
hash: 'HKDF'
hash: 'HKDF',
},
baseKeys[size],
keyType,
@ -604,12 +604,12 @@ async function testDeriveKeyBadUsage(
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
iterations,
hash
hash,
};
return assert.rejects(
subtle.deriveKey(algorithm, noKey[size], keyType, true, usages), {
message: /baseKey does not have deriveKey usage/
message: /baseKey does not have deriveKey usage/,
});
}
@ -619,18 +619,18 @@ async function testWrongKeyType(
hash,
iterations,
keyType,
usages
usages,
) {
const algorithm = {
name: 'PBKDF2',
salt: Buffer.from(kSalts[saltSize], 'hex'),
iterations,
hash
hash,
};
return assert.rejects(
subtle.deriveKey(algorithm, wrongKey, keyType, true, usages), {
message: /Key algorithm mismatch/
message: /Key algorithm mismatch/,
});
}
@ -639,7 +639,7 @@ async function testWrongKeyType(
baseKeys,
noBits,
noKey,
wrongKey
wrongKey,
} = await setupBaseKeys();
const variations = [];

View File

@ -15,7 +15,7 @@ const { once } = require('events');
{
children: [
{ node_name: 'Node / MessagePortData', edge_name: 'data' },
]
],
},
], { loose: true });
await w.terminate();