Skip to content

Instantly share code, notes, and snippets.

@edtsech

edtsech/demo.spec.ts

Last active Jul 11, 2019
Embed
What would you like to do?
/// <reference types="cypress"/>
import createEmptyDb from '../../../back-end/test/create-empty-db'
describe('Demo test', () => {
before(async () => {
await createEmptyDb()
})
...
})
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const path = require('path')
const wp = require('@cypress/webpack-preprocessor')
const nodeExternals = require('webpack-node-externals')
module.exports = (on) => {
const options = {
webpackOptions: {
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js']
},
externals: {
// Possible drivers for knex - we'll ignore them
'knex': 'commonjs knex',
'child_process': 'child_process',
'fs': 'fs',
'dns': 'dns',
'net': 'net',
'pg-native': 'pg-native',
'tls': 'tls'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: { transpileOnly: true }
}
]
}
}
}
on('file:preprocessor', wp(options))
}
{
"compilerOptions": {
"target": "esnext",
"lib": ["esnext", "esnext.asynciterable", "dom"],
"outDir": "dist",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noImplicitAny": false,
"strict": false,
"inlineSources": true,
"types": ["node", "jest"],
"forceConsistentCasingInFileNames": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
"noUnusedParameters": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strictPropertyInitialization": false,
"allowUnreachableCode": false,
"allowJs": true,
"jsx": "react",
"preserveConstEnums": true,
"skipLibCheck": true
},
"exclude": [
".git",
"**/*.spec.js",
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"./node_modules/*"
]
}
@edtsech

This comment has been minimized.

Copy link
Owner Author

@edtsech edtsech commented Jul 11, 2019

Getting this error:
Screen Shot 2019-07-11 at 17 36 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment