Skip to content

Commit 0ce09df

Browse files
committed
test: use vite for cypress component tests fixing babel issue
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent d9bc2ad commit 0ce09df

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

cypress.config.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,12 @@ export default defineConfig({
128128
specPattern: ['core/**/*.cy.ts', 'apps/**/*.cy.ts'],
129129
devServer: {
130130
framework: 'vue',
131-
bundler: 'webpack',
132-
webpackConfig: async () => {
133-
process.env.npm_package_name = 'NcCypress'
134-
process.env.npm_package_version = '1.0.0'
135-
process.env.NODE_ENV = 'development'
136-
137-
/**
138-
* Needed for cypress stubbing
139-
*
140-
* @see https://github.com/sinonjs/sinon/issues/1121
141-
* @see https://github.com/cypress-io/cypress/issues/18662
142-
*/
143-
const babel = require('./babel.config.js')
144-
babel.plugins.push([
145-
'@babel/plugin-transform-modules-commonjs',
146-
{
147-
loose: true,
148-
},
149-
])
150-
151-
const config = webpackConfig
152-
config.module.rules.push({
153-
test: /\.svg$/,
154-
type: 'asset/source',
155-
})
156-
157-
return config
131+
bundler: 'vite',
132+
async viteConfig() {
133+
const { default: vue } = await import('@vitejs/plugin-vue2')
134+
return {
135+
plugins: [vue()],
136+
}
158137
},
159138
},
160139
},

0 commit comments

Comments
 (0)