forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On the fly TypeScript transpile using ts-node (cypress-io#26)
Using require hook
- Loading branch information
Showing
21 changed files
with
79 additions
and
49 deletions.
There are no files selected for viewing
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,2 +1,6 @@ | ||
// @ts-check | ||
|
||
// compile TypeScript files on the fly using | ||
// Node require hook project | ||
require('../ts') | ||
module.exports = require("./lib/launcher") |
1 change: 1 addition & 0 deletions
1
packages/launcher/src/browsers.ts → packages/launcher/lib/browsers.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/launcher/src/darwin/util.ts → packages/launcher/lib/darwin/util.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
1 change: 1 addition & 0 deletions
1
packages/launcher/src/detect.ts → packages/launcher/lib/detect.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
1 change: 1 addition & 0 deletions
1
packages/launcher/src/launcher.ts → packages/launcher/lib/launcher.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
1 change: 1 addition & 0 deletions
1
packages/launcher/src/linux/index.ts → packages/launcher/lib/linux/index.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
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,25 @@ | ||
export type Browser = { | ||
name: string, | ||
re: RegExp, | ||
profile: boolean, | ||
binary: string, | ||
executable: string, | ||
version?: string, | ||
majorVersion?: string, | ||
page?: string | ||
} | ||
|
||
interface ExtraLauncherMethods { | ||
update: Function, | ||
detect: Function | ||
} | ||
|
||
type LauncherLaunch = (browsers?: any[]) => Promise<any> | ||
|
||
export type LauncherApi = LauncherLaunch & ExtraLauncherMethods | ||
|
||
// all common type definition for this module | ||
|
||
export type NotInstalledError = Error & {notInstalled: boolean} | ||
|
||
export type BrowserNotFoundError = Error & {specificBrowserNotFound: boolean} |
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,3 +1,3 @@ | ||
test/unit | ||
--compilers coffee:../coffee/register | ||
--compilers coffee:../coffee/register,ts:../ts/register | ||
--recursive |
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,3 @@ | ||
// gives anyone access to ts-node | ||
// https://github.com/TypeStrong/ts-node#programmatic-usage | ||
module.exports = require('ts-node') |
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,16 @@ | ||
{ | ||
"name": "ts", | ||
"version": "1.0.0", | ||
"description": "TypeScript runtime Node hook", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node test" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"ts-node": "^3.0.4", | ||
"typescript": "^2.3.2" | ||
} | ||
} |
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,6 @@ | ||
// register TypeScript Node require hook | ||
// https://github.com/TypeStrong/ts-node#programmatic-usage | ||
require('ts-node/register') | ||
|
||
// do we need to prevent any other TypeScript hooks? | ||
// like ../coffee/register.js does? |
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,2 @@ | ||
require('../register') | ||
require('./spec') |
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,2 @@ | ||
const add = (a: number, b: number) => a + b | ||
console.assert(add(10, 2) === 12, '10 + 2 should be 12') |
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