Skip to content

Instantly share code, notes, and snippets.

@edtsech
Last active July 11, 2019 15:41
Show Gist options
  • Save edtsech/f45ba2e6d73bdf343e890f5c143bafa4 to your computer and use it in GitHub Desktop.
Save edtsech/f45ba2e6d73bdf343e890f5c143bafa4 to your computer and use it in GitHub Desktop.
/// <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
Copy link
Author

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