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: remove common.fixturesDir #17400

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
5 changes: 0 additions & 5 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ Returns a new promise that will propagate `promise` resolution or rejection if
that happens within the `timeoutMs` timespan, or rejects with `error` as
a reason otherwise.

### fixturesDir
* [<String>]

Path to the 'fixtures' directory.

### getArrayBufferViews(buf)
* `buf` [<Buffer>]
* return [<ArrayBufferView[]>]
Expand Down
4 changes: 1 addition & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ const testRoot = process.env.NODE_TEST_DIR ?

const noop = () => {};

exports.fixturesDir = fixturesDir;

// Using a `.` prefixed name, which is the convention for "hidden" on POSIX,
// gets tools to ignore it by default or by simple rules, especially eslint.
let tmpDirName = '.tmp';
Expand Down Expand Up @@ -303,7 +301,7 @@ exports.childShouldThrowAndAbort = function() {

exports.ddCommand = function(filename, kilobytes) {
if (exports.isWindows) {
const p = path.resolve(exports.fixturesDir, 'create-file.js');
const p = path.resolve(fixturesDir, 'create-file.js');
return `"${process.argv[0]}" "${p}" "${filename}" ${kilobytes * 1024}`;
} else {
return `dd if=/dev/zero of="${filename}" bs=1024 count=${kilobytes}`;
Expand Down
10 changes: 4 additions & 6 deletions test/parallel/test-tls-interleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ if (!common.hasCrypto)
common.skip('missing crypto');

const assert = require('assert');

const tls = require('tls');

const fs = require('fs');
const fixtures = require('../common/fixtures');

const dir = common.fixturesDir;
const options = { key: fs.readFileSync(`${dir}/test_key.pem`),
cert: fs.readFileSync(`${dir}/test_cert.pem`),
ca: [ fs.readFileSync(`${dir}/test_ca.pem`) ] };
const options = { key: fixtures.readSync('test_key.pem'),
cert: fixtures.readSync('test_cert.pem'),
ca: [ fixtures.readSync('test_ca.pem') ] };

const writes = [
'some server data',
Expand Down
7 changes: 4 additions & 3 deletions test/parallel/test-tls-invoke-queued.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ if (!common.hasCrypto)
common.skip('missing crypto');

const assert = require('assert');
const fs = require('fs');
const tls = require('tls');

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

let received = '';

const server = tls.createServer({
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')
}, common.mustCall(function(c) {
c._write('hello ', null, common.mustCall(function() {
c._write('world!', null, common.mustCall(function() {
Expand Down