-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// returns options for ts-node registration | ||
// https://github.com/TypeStrong/ts-node | ||
const _ = require('lodash') | ||
|
||
/** | ||
* Default ts - node options.We want to output CommonJS modules. | ||
* And we want to run fast - thus transpile only mode (no type checking) | ||
*/ | ||
const tsOptions = { | ||
transpileOnly: true, | ||
compilerOptions: { | ||
module: 'CommonJS', | ||
esModuleInterop: true, | ||
}, | ||
} | ||
|
||
/** | ||
* Returns combined object with ts-node options. | ||
* @param {string} tsPath Path to TypeScript | ||
*/ | ||
function getTsNodeOptions (tsPath) { | ||
const merged = _.cloneDeep(tsOptions) | ||
|
||
merged.compiler = tsPath | ||
|
||
return merged | ||
} | ||
|
||
module.exports = { getTsNodeOptions } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { add } from './math' | ||
|
||
it('is true', () => { | ||
expect(add(1, 2)).to.eq(3) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { add } from './math' | ||
|
||
describe('JS spec', () => { | ||
it('adds 2 and 2 together', () => { | ||
expect(add(2, 2)).to.equal(4) | ||
}) | ||
|
||
it('calls task', () => { | ||
cy.task('hello', 'TS').should('equal', 'Hello, TS!') | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const add = (a: number, b: number) => { | ||
return a + b | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const asyncGreeting = async (greeting) => { | ||
return Promise.resolve(`Hello, ${greeting}!`) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// <reference types="cypress" /> | ||
import { asyncGreeting } from './greeting' | ||
|
||
export default (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { | ||
on('task', { | ||
hello: asyncGreeting, | ||
}) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference types="cypress" /> | ||
|
||
// Copied an example command from https://on.cypress.io/custom-commands | ||
Cypress.Commands.add('clickLink', (label: string | number | RegExp) => { | ||
cy.get('a').contains(label).click() | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"importHelpers": true | ||
} | ||
} |
4 comments
on commit aae90bb
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.
Circle has built the linux x64
version of the Test Runner.
You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.
export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/linux-x64/circle-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-313621/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/circle-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-313633/cypress.tgz
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.
AppVeyor has built the win32 x64
version of the Test Runner.
You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.
Instructions are included below, depending on the shell you are using.
In Command Prompt (cmd.exe
):
set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-x64/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
In PowerShell:
$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.5.1/win32-x64/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
In Git Bash:
export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-x64/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
Using cross-env
:
If the above commands do not work for you, you can also try using cross-env
:
npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-x64/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
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.
AppVeyor has built the win32 ia32
version of the Test Runner.
You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.
Instructions are included below, depending on the shell you are using.
In Command Prompt (cmd.exe
):
set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-ia32/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
In PowerShell:
$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.5.1/win32-ia32/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
In Git Bash:
export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-ia32/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
Using cross-env
:
If the above commands do not work for you, you can also try using cross-env
:
npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/win32-ia32/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.5.1/appveyor-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-32633932/cypress.tgz
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.
Circle has built the darwin x64
version of the Test Runner.
You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.
export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.5.1/darwin-x64/circle-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-313641/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.5.1/circle-develop-aae90bbbe06fc2d4de4b14f5b724b254731f9065-313622/cypress.tgz
project