-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor): migrate all tests and test helper code to TS (#649)
- woot, all TS now! - get that big blue line for language TS on GitHub haha - for the most part, not much more to do other than .js -> .ts - for the utils had to add some types around - also use ESM instead of CJS in tests and test helpers - require -> import - module.exports -> export - the indentation change here with utils/fixture made git treat it as a delete + new instead of a rename
- Loading branch information
Showing
10 changed files
with
62 additions
and
63 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
test/e2e/tsdx-build-default.test.js → test/e2e/tsdx-build-default.test.ts
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
7 changes: 4 additions & 3 deletions
7
test/e2e/tsdx-build-invalid.test.js → test/e2e/tsdx-build-invalid.test.ts
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
7 changes: 4 additions & 3 deletions
7
test/e2e/tsdx-build-withTsconfig.test.js → test/e2e/tsdx-build-withTsconfig.test.ts
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
6 changes: 3 additions & 3 deletions
6
test/integration/tsdx-build-options.test.js → test/integration/tsdx-build-options.test.ts
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
6 changes: 3 additions & 3 deletions
6
.../integration/tsdx-build-withBabel.test.js → .../integration/tsdx-build-withBabel.test.ts
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
8 changes: 4 additions & 4 deletions
8
...integration/tsdx-build-withConfig.test.js → ...integration/tsdx-build-withConfig.test.ts
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as path from 'path'; | ||
import * as shell from 'shelljs'; | ||
|
||
export const rootDir = process.cwd(); | ||
|
||
shell.config.silent = true; | ||
|
||
export function setupStageWithFixture( | ||
testDir: string, | ||
stageName: string, | ||
fixtureName: string | ||
): void { | ||
const stagePath = path.join(rootDir, stageName); | ||
shell.mkdir(stagePath); | ||
shell.exec( | ||
`cp -a ${rootDir}/test/${testDir}/fixtures/${fixtureName}/. ${stagePath}/` | ||
); | ||
shell.ln( | ||
'-s', | ||
path.join(rootDir, 'node_modules'), | ||
path.join(stagePath, 'node_modules') | ||
); | ||
shell.cd(stagePath); | ||
} | ||
|
||
export function teardownStage(stageName: string): void { | ||
shell.cd(rootDir); | ||
shell.rm('-rf', path.join(rootDir, stageName)); | ||
} |
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