-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: change to common fixtures module in test file #15886
Conversation
Task to replace the common.fixturesDir with the usage of the common.fixtures module. At Node.js Interactive. First PR to Node.js. Yay!
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`) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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')}`), |
There was a problem hiding this comment.
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')
.
There was a problem hiding this comment.
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')}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
f574cd4
to
12da58b
Compare
@@ -26,6 +26,7 @@ if (!common.hasCrypto) | |||
common.skip('missing crypto'); | |||
|
|||
const assert = require('assert'); | |||
const fixtures = require('../common/fixtures'); | |||
const fs = require('fs'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
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
:)
There was a problem hiding this comment.
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)
12da58b
to
f5572dd
Compare
f5572dd
to
e1089e2
Compare
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>
Landed in 0e1455b |
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>
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>
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>
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>
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>
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
make -j4 test
(UNIX)Affected core subsystem(s)
test