feat: setup cypress
This commit is contained in:

committed by
Gitea

parent
d064f0acc0
commit
7fe9f17e43
@ -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'),
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
9
cypress/plugins/tsconfig.json
Normal file
9
cypress/plugins/tsconfig.json
Normal 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
10
cypress/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "@vue/tsconfig/tsconfig.web.json",
|
||||
"include": ["./integration/**/*", "./support/**/*"],
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false,
|
||||
"target": "es5",
|
||||
"lib": ["es5", "dom"],
|
||||
"types": ["cypress"]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user