Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve coverage on worker threads #36910

Merged
merged 1 commit into from Jan 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions test/parallel/test-worker-unsupported-things.js
Expand Up @@ -24,6 +24,14 @@ if (!process.env.HAS_STARTED_WORKER) {
assert.strictEqual(process.debugPort, before);
}

{
const mask = 0o600;
assert.throws(() => { process.umask(mask); }, {
code: 'ERR_WORKER_UNSUPPORTED_OPERATION',
message: 'Setting process.umask() is not supported in workers'
});
}

const stubs = ['abort', 'chdir', 'send', 'disconnect'];

if (!common.isWindows) {
Expand All @@ -35,13 +43,19 @@ if (!process.env.HAS_STARTED_WORKER) {
assert.strictEqual(process[fn].disabled, true);
assert.throws(() => {
process[fn]();
}, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION' });
}, {
code: 'ERR_WORKER_UNSUPPORTED_OPERATION',
message: `process.${fn}() is not supported in workers`
});
});

['channel', 'connected'].forEach((fn) => {
assert.throws(() => {
process[fn]; // eslint-disable-line no-unused-expressions
}, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION' });
}, {
code: 'ERR_WORKER_UNSUPPORTED_OPERATION',
message: `process.${fn} is not supported in workers`
});
});

assert.strictEqual('_startProfilerIdleNotifier' in process, false);
Expand Down