-
-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests e2e against an
npm pack && npm install
ed ts-node (#1032)
* Tweak tests to run against packed and installed ts-node instead of local dev tree * avoid re-building when packing * fix for node 6 * move npm pack into build step * update package-lock
- Loading branch information
Showing
9 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Written in JS to support Windows | ||
// Would otherwise be written as inline bash in package.json script | ||
|
||
const { exec } = require('child_process') | ||
const { mkdtempSync, writeFileSync, readFileSync, unlinkSync, rmdirSync, readdirSync } = require('fs') | ||
const { join } = require('path') | ||
|
||
const testDir = join(__dirname, '../tests') | ||
const tarballPath = join(testDir, 'ts-node-packed.tgz') | ||
const tempDir = mkdtempSync(join(testDir, 'tmp')) | ||
exec(`npm pack "${join(__dirname, '..')}"`, { cwd: tempDir }, (err, stdout) => { | ||
if (err) { | ||
console.error(err) | ||
process.exit(1) | ||
} | ||
const tempTarballPath = join(tempDir, readdirSync(tempDir)[0]) | ||
writeFileSync(tarballPath, readFileSync(tempTarballPath)) | ||
unlinkSync(tempTarballPath) | ||
rmdirSync(tempDir) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module 'util.promisify' { | ||
const _export: typeof import('util').promisify | ||
export = _export | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
!node_modules/ | ||
!from-node-modules/node_modules/ | ||
package-lock.json | ||
ts-node-packed.tgz |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"ts-node": "file:ts-node-packed.tgz" | ||
} | ||
} |