Skip to content

Commit

Permalink
working setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Apr 3, 2020
1 parent 374a2e3 commit effee46
Show file tree
Hide file tree
Showing 11 changed files with 5,037 additions and 672 deletions.
3 changes: 3 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
2 changes: 2 additions & 0 deletions cypress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/screenshots
/videos
6 changes: 6 additions & 0 deletions cypress/integration/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//declare const LineUpJS: typeof import('../..');

it('works', () => {
cy.wrap('foo').should('equal', 'foo');
// LineUpJS
})
26 changes: 26 additions & 0 deletions cypress/plugins/cy-ts-preprocessor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const wp = require('@cypress/webpack-preprocessor')

const webpackOptions = {
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
use: [
{
loader: 'ts-loader'
}
]
}
]
}
}

const options = {
webpackOptions
}

module.exports = wp(options)
5 changes: 5 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor')

module.exports = on => {
on('file:preprocessor', cypressTypeScriptPreprocessor)
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
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')
12 changes: 12 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"strict": true,
"baseUrl": "../node_modules",
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "mocha", "chai"]
},
"include": [
"**/*.ts"
]
}
Loading

0 comments on commit effee46

Please sign in to comment.