-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
refactor: let TypeScript do resource copying #1824
Changes from all commits
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 |
---|---|---|
|
@@ -211,13 +211,14 @@ describe('HttpServer (integration)', () => { | |
host?: string; | ||
}): HttpServer { | ||
const options: HttpServerOptions = {protocol: 'https', host}; | ||
const certDir = path.resolve(__dirname, '../../../fixtures'); | ||
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 is what annoys me.The directory structure is different between source code and the distribution. In this case, developers can be confused as they might assume IMO, we must fix this confusion in #1636 to make sure the relative path to project level files such as |
||
if (usePfx) { | ||
const pfxPath = path.join(__dirname, 'pfx.pfx'); | ||
const pfxPath = path.join(certDir, 'pfx.pfx'); | ||
options.pfx = fs.readFileSync(pfxPath); | ||
options.passphrase = 'loopback4'; | ||
} else { | ||
const keyPath = path.join(__dirname, 'key.pem'); | ||
const certPath = path.join(__dirname, 'cert.pem'); | ||
const keyPath = path.join(certDir, 'key.pem'); | ||
const certPath = path.join(certDir, 'cert.pem'); | ||
options.key = fs.readFileSync(keyPath); | ||
options.cert = fs.readFileSync(certPath); | ||
} | ||
|
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.
+1 to use TS import for json files.