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: change to common fixtures module in test file #15886

Conversation

bobclewell
Copy link
Contributor

@bobclewell bobclewell commented Oct 6, 2017

Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

Checklist
Affected core subsystem(s)

test

Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 6, 2017
@mscdex mscdex added the https Issues or PRs related to the https subsystem. label Oct 6, 2017
@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 6, 2017
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
key: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-cert.pem`)
Copy link
Member

Choose a reason for hiding this comment

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

There is a dedicated fixtures.readKey function that should be used here. In that case the line is much shorter and you only have to provide the file name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BridgeAR, so for example?

key: fixtures.readKey(`agent1-key.pem`),

@@ -21,6 +21,7 @@

'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can you please move this after the common.hasCrypto check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -34,8 +35,8 @@ const tls = require('tls');
const tests = [];

const serverOptions = {
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
key: fs.readFileSync(`${fixtures.readKey('agent1-key.pem')}`),
Copy link
Member

Choose a reason for hiding this comment

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

This line can simply be key: fixtures.readKey('agent1-key.pem').

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
key: fs.readFileSync(`${fixtures.readKey('agent1-key.pem')}`),
cert: fs.readFileSync(`${fixtures.readKey('agent1-cert.pem')}`)
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto.

@bobclewell bobclewell force-pushed the feature/replace-fixturesDir-with-fixtures-module-in-http-set-timeout-server branch from f574cd4 to 12da58b Compare October 10, 2017 13:51
@@ -26,6 +26,7 @@ if (!common.hasCrypto)
common.skip('missing crypto');

const assert = require('assert');
const fixtures = require('../common/fixtures');
const fs = require('fs');
Copy link
Member

Choose a reason for hiding this comment

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

One last nit: this is no longer needed, so if you can please remove it. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

Something went wrong with last change as you removed fixtures instead of fs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Fixed now. 😄
(fingers-crossed)

@bobclewell bobclewell force-pushed the feature/replace-fixturesDir-with-fixtures-module-in-http-set-timeout-server branch from 12da58b to f5572dd Compare October 10, 2017 14:04
@bobclewell bobclewell force-pushed the feature/replace-fixturesDir-with-fixtures-module-in-http-set-timeout-server branch from f5572dd to e1089e2 Compare October 10, 2017 14:20
@gireeshpunathil
Copy link
Member

jasnell pushed a commit that referenced this pull request Oct 13, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: #15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Oct 13, 2017

Landed in 0e1455b

@jasnell jasnell closed this Oct 13, 2017
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 15, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: nodejs/node#15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Oct 18, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: #15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: #15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: #15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
Task to replace the common.fixturesDir with the usage
of the common.fixtures module. At Node.js Interactive.
First PR to Node.js. Yay!

PR-URL: #15886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. https Issues or PRs related to the https subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants