1
0

feat: setup cypress

This commit is contained in:
Dominik Pschenitschni
2022-02-13 13:49:00 +01:00
committed by Gitea
parent d064f0acc0
commit 7fe9f17e43
6 changed files with 63 additions and 5 deletions

View File

@ -1,4 +1,3 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
@ -12,10 +11,21 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
import path from 'path'
import { startDevServer } from '@cypress/vite-dev-server'
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
export default (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on('dev-server:start', (options) => {
return startDevServer({
options,
viteConfig: {
configFile: path.resolve(__dirname, '..', '..', 'vite.config.ts'),
},
})
})
}

View File

@ -0,0 +1,9 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"include": ["./**/*"],
"compilerOptions": {
"module": "CommonJS",
"preserveValueImports": false,
"types": ["node", "cypress/types/cypress"]
}
}

10
cypress/tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["./integration/**/*", "./support/**/*"],
"compilerOptions": {
"isolatedModules": false,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
}
}