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: rename regression tests #17948

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict';
// Tests that a spawned child process can write to stdout without throwing.
// See https:/nodejs/node-v0.x-archive/issues/1899.

require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use strict';
// Regression test for https:/nodejs/node-v0.x-archive/issues/819.

require('../common');
const net = require('net');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
// Just test that destroying stdin doesn't mess up listening on a server.
// This is a regression test for GH-746.
// This is a regression test for
// https:/nodejs/node-v0.x-archive/issues/746.

const common = require('../common');
const net = require('net');
Expand Down
18 changes: 18 additions & 0 deletions test/parallel/test-os-userinfo-handles-getter-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears (in GitHub) to be new rather than renamed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardlau Yes, I had to split test-regress-GH-12371 into two tests to properly rename it. Thinking about it, I should probably have done that when I originally wrote the regression test for #12371.

// Tests that os.userInfo correctly handles errors thrown by option property
// getters. See https:/nodejs/node/issues/12370.

const common = require('../common');
const assert = require('assert');
const execFile = require('child_process').execFile;

const script = `os.userInfo({
get encoding() {
throw new Error('xyz');
}
})`;

const node = process.execPath;
execFile(node, [ '-e', script ], common.mustCall((err, stdout, stderr) => {
assert(stderr.includes('Error: xyz'), 'userInfo crashes');
}));
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
// Tests that node does neither crash nor throw an error when accessing
// process.env when inside a VM context.
// See https:/nodejs/node-v0.x-archive/issues/7511.

require('../common');
const assert = require('assert');
const vm = require('vm');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
'use strict';
// Tests that vm.createScript and runInThisContext correctly handle errors
// thrown by option property getters.
// See https:/nodejs/node/issues/12369.

const common = require('../common');
const assert = require('assert');
const execFile = require('child_process').execFile;

const scripts = [
`os.userInfo({
get encoding() {
throw new Error('xyz');
}
})`
];
const scripts = [];

['filename', 'cachedData', 'produceCachedData', 'lineOffset', 'columnOffset']
.forEach((prop) => {
Expand Down