Skip to content

Commit

Permalink
test: rename regression tests
Browse files Browse the repository at this point in the history
PR-URL: #17948
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
tniessen authored and MylesBorins committed Jan 9, 2018
1 parent 8806e54 commit 51eab4b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
@@ -1,4 +1,7 @@
'use strict';
// Tests that a spawned child process can write to stdout without throwing.
// See https://github.com/nodejs/node-v0.x-archive/issues/1899.

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

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

Expand Down
@@ -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://github.com/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
@@ -0,0 +1,18 @@
'use strict';
// Tests that os.userInfo correctly handles errors thrown by option property
// getters. See https://github.com/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');
}));
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://github.com/nodejs/node-v0.x-archive/issues/7511.

require('../common');
const assert = require('assert');
const vm = require('vm');
Expand Down
@@ -1,15 +1,13 @@
'use strict';
// Tests that vm.createScript and runInThisContext correctly handle errors
// thrown by option property getters.
// See https://github.com/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

0 comments on commit 51eab4b

Please sign in to comment.