From 9a5c3cf185c6e9c4fb9264cf8e61a74a5d697ff9 Mon Sep 17 00:00:00 2001
From: Miguel Angel Asencio Hurtado
Date: Wed, 9 Aug 2017 19:29:40 +0200
Subject: [PATCH] test: continue normalizing fixtures use
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PR-URL: https://github.com/nodejs/node/pull/14716
Refs: https://github.com/nodejs/node/pull/14332
Reviewed-By: James M Snell
Reviewed-By: Ruben Bridgewater
Reviewed-By: Tobias Nießen
Reviewed-By: Yuta Hiroto
---
test/async-hooks/test-graph.tls-write.js | 7 +++----
test/async-hooks/test-tlswrap.js | 7 +++----
test/async-hooks/test-writewrap.js | 6 +++---
test/doctool/test-doctool-html.js | 11 ++++++-----
test/doctool/test-doctool-json.js | 8 ++++----
test/fixtures/module-require-symlink/symlinked.js | 6 ++----
test/fixtures/tls-connect.js | 13 ++++---------
test/inspector/inspector-helper.js | 4 ++--
test/internet/test-tls-add-ca-cert.js | 4 ++--
test/known_issues/test-repl-require-context.js | 4 ++--
test/known_issues/test-url-parse-conformance.js | 8 +++-----
test/pummel/test-https-ci-reneg-attack.js | 6 +++---
test/pummel/test-https-large-response.js | 6 +++---
test/pummel/test-https-no-reader.js | 7 +++----
test/pummel/test-regress-GH-892.js | 9 ++++-----
test/pummel/test-tls-ci-reneg-attack.js | 6 +++---
test/pummel/test-tls-connect-memleak.js | 6 +++---
test/pummel/test-tls-securepair-client.js | 10 +++-------
test/pummel/test-tls-server-large-request.js | 6 +++---
test/pummel/test-tls-session-timeout.js | 10 ++++------
test/pummel/test-tls-throttle.js | 6 +++---
test/pummel/test-watch-file.js | 8 ++++----
test/sequential/test-debugger-repeat-last.js | 7 ++-----
test/sequential/test-init.js | 4 ++--
24 files changed, 74 insertions(+), 95 deletions(-)
diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js
index 1408ff40ef..4ba264c808 100644
--- a/test/async-hooks/test-graph.tls-write.js
+++ b/test/async-hooks/test-graph.tls-write.js
@@ -9,9 +9,8 @@ if (!common.hasIPv6)
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
-const fs = require('fs');
const tls = require('tls');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const hooks = initHooks();
hooks.enable();
@@ -21,8 +20,8 @@ hooks.enable();
//
const server = tls
.createServer({
- cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')),
- key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'))
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
})
.on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection))
diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js
index 4aa2493765..3876b860ca 100644
--- a/test/async-hooks/test-tlswrap.js
+++ b/test/async-hooks/test-tlswrap.js
@@ -5,8 +5,7 @@ if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
-const fs = require('fs');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const tls = require('tls');
const tick = require('./tick');
@@ -21,8 +20,8 @@ hooks.enable();
//
const server = tls
.createServer({
- cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')),
- key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'))
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
})
.on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection))
diff --git a/test/async-hooks/test-writewrap.js b/test/async-hooks/test-writewrap.js
index 274972e3ee..65f7b6175f 100644
--- a/test/async-hooks/test-writewrap.js
+++ b/test/async-hooks/test-writewrap.js
@@ -6,7 +6,7 @@ if (!common.hasCrypto)
const assert = require('assert');
const initHooks = require('./init-hooks');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
const { checkInvocations } = require('./hook-checks');
const tls = require('tls');
@@ -18,8 +18,8 @@ hooks.enable();
//
const server = tls
.createServer({
- cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`),
- key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`)
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
})
.on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection))
diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js
index 64f1d7f8b1..9a4300a5d0 100644
--- a/test/doctool/test-doctool-html.js
+++ b/test/doctool/test-doctool-html.js
@@ -11,6 +11,7 @@ try {
const assert = require('assert');
const fs = require('fs');
const path = require('path');
+const fixtures = require('../common/fixtures');
const processIncludes = require('../../tools/doc/preprocess.js');
const html = require('../../tools/doc/html.js');
@@ -21,12 +22,12 @@ const html = require('../../tools/doc/html.js');
// have an html parser.
const testData = [
{
- file: path.join(common.fixturesDir, 'sample_document.md'),
+ file: fixtures.path('sample_document.md'),
html: '- fish
fish
Redfish
' +
'- Bluefish
'
},
{
- file: path.join(common.fixturesDir, 'order_of_end_tags_5873.md'),
+ file: fixtures.path('order_of_end_tags_5873.md'),
html: 'ClassMethod: Buffer.from(array) ' +
'#
'
},
{
- file: path.join(common.fixturesDir, 'doc_with_yaml.md'),
+ file: fixtures.path('doc_with_yaml.md'),
html: 'Sample Markdown with YAML info' +
'#
' +
@@ -72,7 +73,7 @@ const testData = [
'
'
},
{
- file: path.join(common.fixturesDir, 'doc_with_includes.md'),
+ file: fixtures.path('doc_with_includes.md'),
html: '' +
'Look here!
' +
'' +
@@ -83,7 +84,7 @@ const testData = [
''
},
{
- file: path.join(common.fixturesDir, 'sample_document.md'),
+ file: fixtures.path('sample_document.md'),
html: '- fish
fish
Redfish
' +
'- Bluefish
',
analyticsId: 'UA-67020396-1'
diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js
index 4a4d3a895c..1be086c3a6 100644
--- a/test/doctool/test-doctool-json.js
+++ b/test/doctool/test-doctool-json.js
@@ -10,7 +10,7 @@ try {
const assert = require('assert');
const fs = require('fs');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const json = require('../../tools/doc/json.js');
// 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.
const testData = [
{
- file: path.join(common.fixturesDir, 'sample_document.md'),
+ file: fixtures.path('sample_document.md'),
json: {
source: 'foo',
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: {
source: 'foo',
modules: [{
@@ -76,7 +76,7 @@ const testData = [
}
},
{
- file: path.join(common.fixturesDir, 'doc_with_yaml.md'),
+ file: fixtures.path('doc_with_yaml.md'),
json: {
source: 'foo',
modules: [
diff --git a/test/fixtures/module-require-symlink/symlinked.js b/test/fixtures/module-require-symlink/symlinked.js
index 657ef26626..ced901b246 100644
--- a/test/fixtures/module-require-symlink/symlinked.js
+++ b/test/fixtures/module-require-symlink/symlinked.js
@@ -1,11 +1,9 @@
'use strict';
-const common = require('../../common');
const assert = require('assert');
const foo = require('./foo');
-const path = require('path');
+const fixtures = require('../../common/fixtures');
-const linkScriptTarget = path.join(common.fixturesDir,
- 'module-require-symlink', 'symlinked.js');
+const linkScriptTarget = fixtures.path('module-require-symlink', 'symlinked.js');
assert.strictEqual(foo.dep1.bar.version, 'CORRECT_VERSION');
assert.strictEqual(foo.dep2.bar.version, 'CORRECT_VERSION');
diff --git a/test/fixtures/tls-connect.js b/test/fixtures/tls-connect.js
index 2ce75a5376..cff4240086 100644
--- a/test/fixtures/tls-connect.js
+++ b/test/fixtures/tls-connect.js
@@ -9,8 +9,7 @@ const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
-const fs = require('fs');
-const join = require('path').join;
+const fixtures = require('../common/fixtures');
const tls = require('tls');
const util = require('util');
@@ -33,17 +32,13 @@ const keys = exports.keys = {
function load(cert, issuer) {
issuer = issuer || cert; // Assume self-signed if no issuer
const id = {
- key: read(cert + '-key.pem'),
- cert: read(cert + '-cert.pem'),
- ca: read(issuer + '-cert.pem'),
+ key: fixtures.readKey(cert + '-key.pem', 'binary'),
+ cert: fixtures.readKey(cert + '-cert.pem', 'binary'),
+ ca: fixtures.readKey(issuer + '-cert.pem', 'binary'),
};
return id;
}
-function read(file) {
- return fs.readFileSync(join(common.fixturesDir, 'keys', file), 'binary');
-}
-
exports.connect = function connect(options, callback) {
callback = common.mustCall(callback);
diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js
index 9c1cca3a77..81aa046bf3 100644
--- a/test/inspector/inspector-helper.js
+++ b/test/inspector/inspector-helper.js
@@ -3,11 +3,11 @@ const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const http = require('http');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const { spawn } = require('child_process');
const url = require('url');
-const _MAINSCRIPT = path.join(common.fixturesDir, 'loop.js');
+const _MAINSCRIPT = fixtures.path('loop.js');
const DEBUG = false;
const TIMEOUT = common.platformTimeout(15 * 1000);
diff --git a/test/internet/test-tls-add-ca-cert.js b/test/internet/test-tls-add-ca-cert.js
index 299e01405d..c3780acd50 100644
--- a/test/internet/test-tls-add-ca-cert.js
+++ b/test/internet/test-tls-add-ca-cert.js
@@ -8,11 +8,11 @@ if (!common.hasCrypto)
const assert = require('assert');
const fs = require('fs');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const tls = require('tls');
function filenamePEM(n) {
- return path.join(common.fixturesDir, 'keys', `${n}.pem`);
+ return fixtures.path('keys', `${n}.pem`);
}
function loadPEM(n) {
diff --git a/test/known_issues/test-repl-require-context.js b/test/known_issues/test-repl-require-context.js
index e7a27f2ca6..2b8737b867 100644
--- a/test/known_issues/test-repl-require-context.js
+++ b/test/known_issues/test-repl-require-context.js
@@ -2,12 +2,12 @@
// Refs: https://github.com/nodejs/node/issues/7788
const common = require('../common');
const assert = require('assert');
-const path = require('path');
+const path = require('../common/fixtures').path;
const repl = require('repl');
const stream = require('stream');
const inputStream = 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({
input: inputStream,
output: outputStream,
diff --git a/test/known_issues/test-url-parse-conformance.js b/test/known_issues/test-url-parse-conformance.js
index 62c36da87e..022a613a22 100644
--- a/test/known_issues/test-url-parse-conformance.js
+++ b/test/known_issues/test-url-parse-conformance.js
@@ -1,13 +1,11 @@
'use strict';
// Refs: https://github.com/nodejs/node/issues/5832
-
-const common = require('../common');
+require('../common');
const url = require('url');
const assert = require('assert');
-const path = require('path');
-
-const tests = require(path.join(common.fixturesDir, 'url-tests'));
+const fixtures = require('../common/fixtures');
+const tests = require(fixtures.path('url-tests'));
let failed = 0;
let attempted = 0;
diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js
index fbe0e37873..9e132b7df9 100644
--- a/test/pummel/test-https-ci-reneg-attack.js
+++ b/test/pummel/test-https-ci-reneg-attack.js
@@ -31,7 +31,7 @@ const assert = require('assert');
const spawn = require('child_process').spawn;
const tls = require('tls');
const https = require('https');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
// renegotiation limits to test
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) {
const options = {
- cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`),
- key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`)
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
};
let seenError = false;
diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js
index 7775ccca63..d72fd2a65b 100644
--- a/test/pummel/test-https-large-response.js
+++ b/test/pummel/test-https-large-response.js
@@ -25,12 +25,12 @@ if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
const https = require('https');
const options = {
- key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
- cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
+ key: fixtures.readKey('agent1-key.pem'),
+ cert: fixtures.readKey('agent1-cert.pem')
};
process.stdout.write('build body...');
diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js
index b8071b9ba9..985d888e6d 100644
--- a/test/pummel/test-https-no-reader.js
+++ b/test/pummel/test-https-no-reader.js
@@ -26,12 +26,11 @@ if (!common.hasCrypto)
const assert = require('assert');
const https = require('https');
-const fs = require('fs');
-const path = require('path');
+const fixtures = require('../common/fixtures');
const options = {
- key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')),
- cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))
+ key: fixtures.readSync('test_key.pem'),
+ cert: fixtures.readSync('test_cert.pem')
};
const buf = Buffer.allocUnsafe(1024 * 1024);
diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js
index 76f98b2957..05e27628b1 100644
--- a/test/pummel/test-regress-GH-892.js
+++ b/test/pummel/test-regress-GH-892.js
@@ -33,14 +33,13 @@ if (!common.hasCrypto)
const assert = require('assert');
const spawn = require('child_process').spawn;
const https = require('https');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
const bytesExpected = 1024 * 1024 * 32;
let started = false;
-const childScript = require('path').join(common.fixturesDir,
- 'GH-892-request.js');
+const childScript = fixtures.path('GH-892-request.js');
function makeRequest() {
if (started) return;
@@ -78,8 +77,8 @@ function makeRequest() {
const serverOptions = {
- key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
- cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
+ key: fixtures.readKey('agent1-key.pem'),
+ cert: fixtures.readKey('agent1-cert.pem')
};
let uploadCount = 0;
diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js
index 905d922db3..dede8ec9db 100644
--- a/test/pummel/test-tls-ci-reneg-attack.js
+++ b/test/pummel/test-tls-ci-reneg-attack.js
@@ -30,7 +30,7 @@ if (!common.opensslCli)
const assert = require('assert');
const spawn = require('child_process').spawn;
const tls = require('tls');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
// renegotiation limits to test
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) {
const options = {
- cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`),
- key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`)
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
};
let seenError = false;
diff --git a/test/pummel/test-tls-connect-memleak.js b/test/pummel/test-tls-connect-memleak.js
index c086933a3e..4425e8d04e 100644
--- a/test/pummel/test-tls-connect-memleak.js
+++ b/test/pummel/test-tls-connect-memleak.js
@@ -28,7 +28,7 @@ if (!common.hasCrypto)
const assert = require('assert');
const tls = require('tls');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
assert.strictEqual(
typeof global.gc,
@@ -37,8 +37,8 @@ assert.strictEqual(
);
tls.createServer({
- cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`),
- key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`)
+ cert: fixtures.readSync('test_cert.pem'),
+ key: fixtures.readSync('test_key.pem')
}).listen(common.PORT);
{
diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js
index e1a489a145..dbcd33d534 100644
--- a/test/pummel/test-tls-securepair-client.js
+++ b/test/pummel/test-tls-securepair-client.js
@@ -29,10 +29,9 @@ if (!common.opensslCli)
if (!common.hasCrypto)
common.skip('missing crypto');
-const join = require('path').join;
const net = require('net');
const assert = require('assert');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
const tls = require('tls');
const spawn = require('child_process').spawn;
@@ -56,11 +55,8 @@ function test2() {
}
function test(keyfn, certfn, check, next) {
- keyfn = join(common.fixturesDir, keyfn);
- const key = fs.readFileSync(keyfn).toString();
-
- certfn = join(common.fixturesDir, certfn);
- const cert = fs.readFileSync(certfn).toString();
+ const key = fixtures.readSync(keyfn).toString();
+ const cert = fixtures.readSync(certfn).toString();
const server = spawn(common.opensslCli, ['s_server',
'-accept', common.PORT,
diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js
index 3255633ec7..a99c142d53 100644
--- a/test/pummel/test-tls-server-large-request.js
+++ b/test/pummel/test-tls-server-large-request.js
@@ -26,15 +26,15 @@ if (!common.hasCrypto)
const assert = require('assert');
const tls = require('tls');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
const stream = require('stream');
const util = require('util');
const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb
const options = {
- key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
- cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
+ key: fixtures.readKey('agent1-key.pem'),
+ cert: fixtures.readKey('agent1-cert.pem')
};
function Mediator() {
diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js
index 9b175da77e..56fdfa16ea 100644
--- a/test/pummel/test-tls-session-timeout.js
+++ b/test/pummel/test-tls-session-timeout.js
@@ -43,14 +43,13 @@ function doTest() {
const tls = require('tls');
const fs = require('fs');
const join = require('path').join;
+ const fixtures = require('../common/fixtures');
const spawn = require('child_process').spawn;
const SESSION_TIMEOUT = 1;
- const keyFile = join(common.fixturesDir, 'agent.key');
- const certFile = join(common.fixturesDir, 'agent.crt');
- const key = fs.readFileSync(keyFile);
- const cert = fs.readFileSync(certFile);
+ const key = fixtures.path('agent.key');
+ const cert = fixtures.path('agent.crt');
const options = {
key: key,
cert: cert,
@@ -66,9 +65,8 @@ function doTest() {
const sessionFileName = (function() {
const ticketFileName = 'tls-session-ticket.txt';
- const fixturesPath = join(common.fixturesDir, ticketFileName);
const tmpPath = join(common.tmpDir, ticketFileName);
- fs.writeFileSync(tmpPath, fs.readFileSync(fixturesPath));
+ fs.writeFileSync(tmpPath, fixtures.readSync(ticketFileName));
return tmpPath;
}());
diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js
index 2d0ea1c673..3e18c4cff4 100644
--- a/test/pummel/test-tls-throttle.js
+++ b/test/pummel/test-tls-throttle.js
@@ -29,15 +29,15 @@ if (!common.hasCrypto)
const assert = require('assert');
const tls = require('tls');
-const fs = require('fs');
+const fixtures = require('../common/fixtures');
process.stdout.write('build body...');
const body = 'hello world\n'.repeat(1024 * 1024);
process.stdout.write('done\n');
const options = {
- key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`),
- cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`)
+ key: fixtures.readKey('agent2-key.pem'),
+ cert: fixtures.readKey('agent2-cert.pem')
};
const server = tls.Server(options, common.mustCall(function(socket) {
diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js
index 0ca8154ee2..4a72820520 100644
--- a/test/pummel/test-watch-file.js
+++ b/test/pummel/test-watch-file.js
@@ -20,13 +20,13 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
-const common = require('../common');
-const assert = require('assert');
+require('../common');
+const assert = require('assert');
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;
function watchFile() {
diff --git a/test/sequential/test-debugger-repeat-last.js b/test/sequential/test-debugger-repeat-last.js
index 39572ab99b..42638e5d2e 100644
--- a/test/sequential/test-debugger-repeat-last.js
+++ b/test/sequential/test-debugger-repeat-last.js
@@ -1,13 +1,10 @@
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
-const path = require('path');
+const path = require('../common/fixtures').path;
const spawn = require('child_process').spawn;
const assert = require('assert');
-const fixture = path.join(
- common.fixturesDir,
- 'debugger-repeat-last.js'
-);
+const fixture = path('debugger-repeat-last.js');
const args = [
'inspect',
diff --git a/test/sequential/test-init.js b/test/sequential/test-init.js
index 5ca0de7db3..3c3653521d 100644
--- a/test/sequential/test-init.js
+++ b/test/sequential/test-init.js
@@ -23,7 +23,7 @@
const common = require('../common');
const assert = require('assert');
const child = require('child_process');
-const path = require('path');
+const fixtures = require('../common/fixtures');
if (process.env['TEST_INIT']) {
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
// instead of the desired file and that the fs module loads as
// expected in node
- process.chdir(path.join(common.fixturesDir, 'test-init-native'));
+ process.chdir(fixtures.path('test-init-native'));
test('fs', 'fs loaded successfully');
}