Browse Source

test: continue normalizing fixtures use

PR-URL: https://github.com/nodejs/node/pull/14716
Refs: https://github.com/nodejs/node/pull/14332
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
canary-base
Miguel Angel Asencio Hurtado 7 years ago
committed by Ruben Bridgewater
parent
commit
9a5c3cf185
No known key found for this signature in database GPG Key ID: F07496B3EB3C1762
  1. 7
      test/async-hooks/test-graph.tls-write.js
  2. 7
      test/async-hooks/test-tlswrap.js
  3. 6
      test/async-hooks/test-writewrap.js
  4. 11
      test/doctool/test-doctool-html.js
  5. 8
      test/doctool/test-doctool-json.js
  6. 6
      test/fixtures/module-require-symlink/symlinked.js
  7. 13
      test/fixtures/tls-connect.js
  8. 4
      test/inspector/inspector-helper.js
  9. 4
      test/internet/test-tls-add-ca-cert.js
  10. 4
      test/known_issues/test-repl-require-context.js
  11. 8
      test/known_issues/test-url-parse-conformance.js
  12. 6
      test/pummel/test-https-ci-reneg-attack.js
  13. 6
      test/pummel/test-https-large-response.js
  14. 7
      test/pummel/test-https-no-reader.js
  15. 9
      test/pummel/test-regress-GH-892.js
  16. 6
      test/pummel/test-tls-ci-reneg-attack.js
  17. 6
      test/pummel/test-tls-connect-memleak.js
  18. 10
      test/pummel/test-tls-securepair-client.js
  19. 6
      test/pummel/test-tls-server-large-request.js
  20. 10
      test/pummel/test-tls-session-timeout.js
  21. 6
      test/pummel/test-tls-throttle.js
  22. 8
      test/pummel/test-watch-file.js
  23. 7
      test/sequential/test-debugger-repeat-last.js
  24. 4
      test/sequential/test-init.js

7
test/async-hooks/test-graph.tls-write.js

@ -9,9 +9,8 @@ if (!common.hasIPv6)
const initHooks = require('./init-hooks'); const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph'); const verifyGraph = require('./verify-graph');
const fs = require('fs');
const tls = require('tls'); const tls = require('tls');
const path = require('path'); const fixtures = require('../common/fixtures');
const hooks = initHooks(); const hooks = initHooks();
hooks.enable(); hooks.enable();
@ -21,8 +20,8 @@ hooks.enable();
// //
const server = tls const server = tls
.createServer({ .createServer({
cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')) key: fixtures.readSync('test_key.pem')
}) })
.on('listening', common.mustCall(onlistening)) .on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection)) .on('secureConnection', common.mustCall(onsecureConnection))

7
test/async-hooks/test-tlswrap.js

@ -5,8 +5,7 @@ if (!common.hasCrypto)
common.skip('missing crypto'); common.skip('missing crypto');
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const path = require('path');
const tls = require('tls'); const tls = require('tls');
const tick = require('./tick'); const tick = require('./tick');
@ -21,8 +20,8 @@ hooks.enable();
// //
const server = tls const server = tls
.createServer({ .createServer({
cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')) key: fixtures.readSync('test_key.pem')
}) })
.on('listening', common.mustCall(onlistening)) .on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection)) .on('secureConnection', common.mustCall(onsecureConnection))

6
test/async-hooks/test-writewrap.js

@ -6,7 +6,7 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const initHooks = require('./init-hooks'); const initHooks = require('./init-hooks');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const { checkInvocations } = require('./hook-checks'); const { checkInvocations } = require('./hook-checks');
const tls = require('tls'); const tls = require('tls');
@ -18,8 +18,8 @@ hooks.enable();
// //
const server = tls const server = tls
.createServer({ .createServer({
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`) key: fixtures.readSync('test_key.pem')
}) })
.on('listening', common.mustCall(onlistening)) .on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection)) .on('secureConnection', common.mustCall(onsecureConnection))

11
test/doctool/test-doctool-html.js

@ -11,6 +11,7 @@ try {
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const fixtures = require('../common/fixtures');
const processIncludes = require('../../tools/doc/preprocess.js'); const processIncludes = require('../../tools/doc/preprocess.js');
const html = require('../../tools/doc/html.js'); const html = require('../../tools/doc/html.js');
@ -21,12 +22,12 @@ const html = require('../../tools/doc/html.js');
// have an html parser. // have an html parser.
const testData = [ const testData = [
{ {
file: path.join(common.fixturesDir, 'sample_document.md'), file: fixtures.path('sample_document.md'),
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' + html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
'<li>Bluefish</li></ol>' '<li>Bluefish</li></ol>'
}, },
{ {
file: path.join(common.fixturesDir, 'order_of_end_tags_5873.md'), file: fixtures.path('order_of_end_tags_5873.md'),
html: '<h3>ClassMethod: Buffer.from(array) <span> ' + html: '<h3>ClassMethod: Buffer.from(array) <span> ' +
'<a class="mark" href="#foo_class_method_buffer_from_array" ' + '<a class="mark" href="#foo_class_method_buffer_from_array" ' +
'id="foo_class_method_buffer_from_array">#</a> </span> </h3><div' + 'id="foo_class_method_buffer_from_array">#</a> </span> </h3><div' +
@ -36,7 +37,7 @@ const testData = [
'</ul></div>' '</ul></div>'
}, },
{ {
file: path.join(common.fixturesDir, 'doc_with_yaml.md'), file: fixtures.path('doc_with_yaml.md'),
html: '<h1>Sample Markdown with YAML info' + html: '<h1>Sample Markdown with YAML info' +
'<span><a class="mark" href="#foo_sample_markdown_with_yaml_info" ' + '<span><a class="mark" href="#foo_sample_markdown_with_yaml_info" ' +
' id="foo_sample_markdown_with_yaml_info">#</a></span></h1>' + ' id="foo_sample_markdown_with_yaml_info">#</a></span></h1>' +
@ -72,7 +73,7 @@ const testData = [
'</p>' '</p>'
}, },
{ {
file: path.join(common.fixturesDir, 'doc_with_includes.md'), file: fixtures.path('doc_with_includes.md'),
html: '<!-- [start-include:doc_inc_1.md] -->' + html: '<!-- [start-include:doc_inc_1.md] -->' +
'<p>Look <a href="doc_inc_2.html#doc_inc_2_foobar">here</a>!</p>' + '<p>Look <a href="doc_inc_2.html#doc_inc_2_foobar">here</a>!</p>' +
'<!-- [end-include:doc_inc_1.md] -->' + '<!-- [end-include:doc_inc_1.md] -->' +
@ -83,7 +84,7 @@ const testData = [
'<!-- [end-include:doc_inc_2.md] -->' '<!-- [end-include:doc_inc_2.md] -->'
}, },
{ {
file: path.join(common.fixturesDir, 'sample_document.md'), file: fixtures.path('sample_document.md'),
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' + html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
'<li>Bluefish</li></ol>', '<li>Bluefish</li></ol>',
analyticsId: 'UA-67020396-1' analyticsId: 'UA-67020396-1'

8
test/doctool/test-doctool-json.js

@ -10,7 +10,7 @@ try {
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const fixtures = require('../common/fixtures');
const json = require('../../tools/doc/json.js'); const json = require('../../tools/doc/json.js');
// Outputs valid json with the expected fields when given simple markdown // Outputs valid json with the expected fields when given simple markdown
@ -19,7 +19,7 @@ const json = require('../../tools/doc/json.js');
// The json property is some json which will be generated by the doctool. // The json property is some json which will be generated by the doctool.
const testData = [ const testData = [
{ {
file: path.join(common.fixturesDir, 'sample_document.md'), file: fixtures.path('sample_document.md'),
json: { json: {
source: 'foo', source: 'foo',
modules: [{ modules: [{
@ -39,7 +39,7 @@ const testData = [
} }
}, },
{ {
file: path.join(common.fixturesDir, 'order_of_end_tags_5873.md'), file: fixtures.path('order_of_end_tags_5873.md'),
json: { json: {
source: 'foo', source: 'foo',
modules: [{ modules: [{
@ -76,7 +76,7 @@ const testData = [
} }
}, },
{ {
file: path.join(common.fixturesDir, 'doc_with_yaml.md'), file: fixtures.path('doc_with_yaml.md'),
json: { json: {
source: 'foo', source: 'foo',
modules: [ modules: [

6
test/fixtures/module-require-symlink/symlinked.js

@ -1,11 +1,9 @@
'use strict'; 'use strict';
const common = require('../../common');
const assert = require('assert'); const assert = require('assert');
const foo = require('./foo'); const foo = require('./foo');
const path = require('path'); const fixtures = require('../../common/fixtures');
const linkScriptTarget = path.join(common.fixturesDir, const linkScriptTarget = fixtures.path('module-require-symlink', 'symlinked.js');
'module-require-symlink', 'symlinked.js');
assert.strictEqual(foo.dep1.bar.version, 'CORRECT_VERSION'); assert.strictEqual(foo.dep1.bar.version, 'CORRECT_VERSION');
assert.strictEqual(foo.dep2.bar.version, 'CORRECT_VERSION'); assert.strictEqual(foo.dep2.bar.version, 'CORRECT_VERSION');

13
test/fixtures/tls-connect.js

@ -9,8 +9,7 @@ const common = require('../common');
if (!common.hasCrypto) if (!common.hasCrypto)
common.skip('missing crypto'); common.skip('missing crypto');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const join = require('path').join;
const tls = require('tls'); const tls = require('tls');
const util = require('util'); const util = require('util');
@ -33,17 +32,13 @@ const keys = exports.keys = {
function load(cert, issuer) { function load(cert, issuer) {
issuer = issuer || cert; // Assume self-signed if no issuer issuer = issuer || cert; // Assume self-signed if no issuer
const id = { const id = {
key: read(cert + '-key.pem'), key: fixtures.readKey(cert + '-key.pem', 'binary'),
cert: read(cert + '-cert.pem'), cert: fixtures.readKey(cert + '-cert.pem', 'binary'),
ca: read(issuer + '-cert.pem'), ca: fixtures.readKey(issuer + '-cert.pem', 'binary'),
}; };
return id; return id;
} }
function read(file) {
return fs.readFileSync(join(common.fixturesDir, 'keys', file), 'binary');
}
exports.connect = function connect(options, callback) { exports.connect = function connect(options, callback) {
callback = common.mustCall(callback); callback = common.mustCall(callback);

4
test/inspector/inspector-helper.js

@ -3,11 +3,11 @@ const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const http = require('http'); const http = require('http');
const path = require('path'); const fixtures = require('../common/fixtures');
const { spawn } = require('child_process'); const { spawn } = require('child_process');
const url = require('url'); const url = require('url');
const _MAINSCRIPT = path.join(common.fixturesDir, 'loop.js'); const _MAINSCRIPT = fixtures.path('loop.js');
const DEBUG = false; const DEBUG = false;
const TIMEOUT = common.platformTimeout(15 * 1000); const TIMEOUT = common.platformTimeout(15 * 1000);

4
test/internet/test-tls-add-ca-cert.js

@ -8,11 +8,11 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const fixtures = require('../common/fixtures');
const tls = require('tls'); const tls = require('tls');
function filenamePEM(n) { function filenamePEM(n) {
return path.join(common.fixturesDir, 'keys', `${n}.pem`); return fixtures.path('keys', `${n}.pem`);
} }
function loadPEM(n) { function loadPEM(n) {

4
test/known_issues/test-repl-require-context.js

@ -2,12 +2,12 @@
// Refs: https://github.com/nodejs/node/issues/7788 // Refs: https://github.com/nodejs/node/issues/7788
const common = require('../common'); const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const path = require('path'); const path = require('../common/fixtures').path;
const repl = require('repl'); const repl = require('repl');
const stream = require('stream'); const stream = require('stream');
const inputStream = new stream.PassThrough(); const inputStream = new stream.PassThrough();
const outputStream = new stream.PassThrough(); const outputStream = new stream.PassThrough();
const fixture = path.join(common.fixturesDir, 'is-object.js'); const fixture = path('is-object.js');
const r = repl.start({ const r = repl.start({
input: inputStream, input: inputStream,
output: outputStream, output: outputStream,

8
test/known_issues/test-url-parse-conformance.js

@ -1,13 +1,11 @@
'use strict'; 'use strict';
// Refs: https://github.com/nodejs/node/issues/5832 // Refs: https://github.com/nodejs/node/issues/5832
require('../common');
const common = require('../common');
const url = require('url'); const url = require('url');
const assert = require('assert'); const assert = require('assert');
const path = require('path'); const fixtures = require('../common/fixtures');
const tests = require(fixtures.path('url-tests'));
const tests = require(path.join(common.fixturesDir, 'url-tests'));
let failed = 0; let failed = 0;
let attempted = 0; let attempted = 0;

6
test/pummel/test-https-ci-reneg-attack.js

@ -31,7 +31,7 @@ const assert = require('assert');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const tls = require('tls'); const tls = require('tls');
const https = require('https'); const https = require('https');
const fs = require('fs'); const fixtures = require('../common/fixtures');
// renegotiation limits to test // renegotiation limits to test
const LIMITS = [0, 1, 2, 3, 5, 10, 16]; const LIMITS = [0, 1, 2, 3, 5, 10, 16];
@ -48,8 +48,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16];
function test(next) { function test(next) {
const options = { const options = {
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`) key: fixtures.readSync('test_key.pem')
}; };
let seenError = false; let seenError = false;

6
test/pummel/test-https-large-response.js

@ -25,12 +25,12 @@ if (!common.hasCrypto)
common.skip('missing crypto'); common.skip('missing crypto');
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const https = require('https'); const https = require('https');
const options = { const options = {
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), key: fixtures.readKey('agent1-key.pem'),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) cert: fixtures.readKey('agent1-cert.pem')
}; };
process.stdout.write('build body...'); process.stdout.write('build body...');

7
test/pummel/test-https-no-reader.js

@ -26,12 +26,11 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const https = require('https'); const https = require('https');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const path = require('path');
const options = { const options = {
key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), key: fixtures.readSync('test_key.pem'),
cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')) cert: fixtures.readSync('test_cert.pem')
}; };
const buf = Buffer.allocUnsafe(1024 * 1024); const buf = Buffer.allocUnsafe(1024 * 1024);

9
test/pummel/test-regress-GH-892.js

@ -33,14 +33,13 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const https = require('https'); const https = require('https');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const bytesExpected = 1024 * 1024 * 32; const bytesExpected = 1024 * 1024 * 32;
let started = false; let started = false;
const childScript = require('path').join(common.fixturesDir, const childScript = fixtures.path('GH-892-request.js');
'GH-892-request.js');
function makeRequest() { function makeRequest() {
if (started) return; if (started) return;
@ -78,8 +77,8 @@ function makeRequest() {
const serverOptions = { const serverOptions = {
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), key: fixtures.readKey('agent1-key.pem'),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) cert: fixtures.readKey('agent1-cert.pem')
}; };
let uploadCount = 0; let uploadCount = 0;

6
test/pummel/test-tls-ci-reneg-attack.js

@ -30,7 +30,7 @@ if (!common.opensslCli)
const assert = require('assert'); const assert = require('assert');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const tls = require('tls'); const tls = require('tls');
const fs = require('fs'); const fixtures = require('../common/fixtures');
// renegotiation limits to test // renegotiation limits to test
const LIMITS = [0, 1, 2, 3, 5, 10, 16]; const LIMITS = [0, 1, 2, 3, 5, 10, 16];
@ -47,8 +47,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16];
function test(next) { function test(next) {
const options = { const options = {
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`) key: fixtures.readSync('test_key.pem')
}; };
let seenError = false; let seenError = false;

6
test/pummel/test-tls-connect-memleak.js

@ -28,7 +28,7 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const tls = require('tls'); const tls = require('tls');
const fs = require('fs'); const fixtures = require('../common/fixtures');
assert.strictEqual( assert.strictEqual(
typeof global.gc, typeof global.gc,
@ -37,8 +37,8 @@ assert.strictEqual(
); );
tls.createServer({ tls.createServer({
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`), cert: fixtures.readSync('test_cert.pem'),
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`) key: fixtures.readSync('test_key.pem')
}).listen(common.PORT); }).listen(common.PORT);
{ {

10
test/pummel/test-tls-securepair-client.js

@ -29,10 +29,9 @@ if (!common.opensslCli)
if (!common.hasCrypto) if (!common.hasCrypto)
common.skip('missing crypto'); common.skip('missing crypto');
const join = require('path').join;
const net = require('net'); const net = require('net');
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const tls = require('tls'); const tls = require('tls');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
@ -56,11 +55,8 @@ function test2() {
} }
function test(keyfn, certfn, check, next) { function test(keyfn, certfn, check, next) {
keyfn = join(common.fixturesDir, keyfn); const key = fixtures.readSync(keyfn).toString();
const key = fs.readFileSync(keyfn).toString(); const cert = fixtures.readSync(certfn).toString();
certfn = join(common.fixturesDir, certfn);
const cert = fs.readFileSync(certfn).toString();
const server = spawn(common.opensslCli, ['s_server', const server = spawn(common.opensslCli, ['s_server',
'-accept', common.PORT, '-accept', common.PORT,

6
test/pummel/test-tls-server-large-request.js

@ -26,15 +26,15 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const tls = require('tls'); const tls = require('tls');
const fs = require('fs'); const fixtures = require('../common/fixtures');
const stream = require('stream'); const stream = require('stream');
const util = require('util'); const util = require('util');
const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb
const options = { const options = {
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), key: fixtures.readKey('agent1-key.pem'),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) cert: fixtures.readKey('agent1-cert.pem')
}; };
function Mediator() { function Mediator() {

10
test/pummel/test-tls-session-timeout.js

@ -43,14 +43,13 @@ function doTest() {
const tls = require('tls'); const tls = require('tls');
const fs = require('fs'); const fs = require('fs');
const join = require('path').join; const join = require('path').join;
const fixtures = require('../common/fixtures');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const SESSION_TIMEOUT = 1; const SESSION_TIMEOUT = 1;
const keyFile = join(common.fixturesDir, 'agent.key'); const key = fixtures.path('agent.key');
const certFile = join(common.fixturesDir, 'agent.crt'); const cert = fixtures.path('agent.crt');
const key = fs.readFileSync(keyFile);
const cert = fs.readFileSync(certFile);
const options = { const options = {
key: key, key: key,
cert: cert, cert: cert,
@ -66,9 +65,8 @@ function doTest() {
const sessionFileName = (function() { const sessionFileName = (function() {
const ticketFileName = 'tls-session-ticket.txt'; const ticketFileName = 'tls-session-ticket.txt';
const fixturesPath = join(common.fixturesDir, ticketFileName);
const tmpPath = join(common.tmpDir, ticketFileName); const tmpPath = join(common.tmpDir, ticketFileName);
fs.writeFileSync(tmpPath, fs.readFileSync(fixturesPath)); fs.writeFileSync(tmpPath, fixtures.readSync(ticketFileName));
return tmpPath; return tmpPath;
}()); }());

6
test/pummel/test-tls-throttle.js

@ -29,15 +29,15 @@ if (!common.hasCrypto)
const assert = require('assert'); const assert = require('assert');
const tls = require('tls'); const tls = require('tls');
const fs = require('fs'); const fixtures = require('../common/fixtures');
process.stdout.write('build body...'); process.stdout.write('build body...');
const body = 'hello world\n'.repeat(1024 * 1024); const body = 'hello world\n'.repeat(1024 * 1024);
process.stdout.write('done\n'); process.stdout.write('done\n');
const options = { const options = {
key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), key: fixtures.readKey('agent2-key.pem'),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) cert: fixtures.readKey('agent2-cert.pem')
}; };
const server = tls.Server(options, common.mustCall(function(socket) { const server = tls.Server(options, common.mustCall(function(socket) {

8
test/pummel/test-watch-file.js

@ -20,13 +20,13 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE. // USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'; 'use strict';
const common = require('../common');
const assert = require('assert');
require('../common');
const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const fixtures = require('../common/fixtures');
const f = path.join(common.fixturesDir, 'x.txt'); const f = fixtures.path('x.txt');
let changes = 0; let changes = 0;
function watchFile() { function watchFile() {

7
test/sequential/test-debugger-repeat-last.js

@ -1,13 +1,10 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
common.skipIfInspectorDisabled(); common.skipIfInspectorDisabled();
const path = require('path'); const path = require('../common/fixtures').path;
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const assert = require('assert'); const assert = require('assert');
const fixture = path.join( const fixture = path('debugger-repeat-last.js');
common.fixturesDir,
'debugger-repeat-last.js'
);
const args = [ const args = [
'inspect', 'inspect',

4
test/sequential/test-init.js

@ -23,7 +23,7 @@
const common = require('../common'); const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const child = require('child_process'); const child = require('child_process');
const path = require('path'); const fixtures = require('../common/fixtures');
if (process.env['TEST_INIT']) { if (process.env['TEST_INIT']) {
return process.stdout.write('Loaded successfully!'); return process.stdout.write('Loaded successfully!');
@ -57,6 +57,6 @@ function test(file, expected) {
// ensures that `node fs` does not mistakenly load the native 'fs' module // ensures that `node fs` does not mistakenly load the native 'fs' module
// instead of the desired file and that the fs module loads as // instead of the desired file and that the fs module loads as
// expected in node // expected in node
process.chdir(path.join(common.fixturesDir, 'test-init-native')); process.chdir(fixtures.path('test-init-native'));
test('fs', 'fs loaded successfully'); test('fs', 'fs loaded successfully');
} }

Loading…
Cancel
Save