-
-
Notifications
You must be signed in to change notification settings - Fork 36k
test: update test to use fixtures #15844
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
Changes from 2 commits
f5a085e
8110afd
6dd3bb7
6e84d1f
391f0f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
|
|
||
| 'use strict'; | ||
| const common = require('../common'); | ||
| const fixtures = require('../common/fixtures'); | ||
| if (!common.hasCrypto) | ||
| common.skip('missing crypto'); | ||
|
|
||
|
|
@@ -30,12 +31,12 @@ const fs = require('fs'); | |
|
|
||
| const options = { | ||
| key: [ | ||
| fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), | ||
| fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), | ||
| fs.readFileSync(fixtures.path('/keys/ec-key.pem')), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be using method
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make a difference that fs.readFileSync() is platform specific (though only if the path is a directory I see...so not an issue). I've always been taught to keep it as simple as possible...so I assumed using path.join() is just a bit clearer? But live and learn! :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The readFileSync(fixtures(keys...)) pattern is so common in the tests that the Something like |
||
| fs.readFileSync(fixtures.path('/keys/agent1-key.pem')), | ||
| ], | ||
| cert: [ | ||
| fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), | ||
| fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) | ||
| fs.readFileSync(fixtures.path('/keys/agent1-cert.pem')), | ||
| fs.readFileSync(fixtures.path('/keys/ec-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.
Nit: would you mind moving this after the
common.hasCryptocheck?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.
Not at all! Done!