mirror of
https://github.com/vercel/commerce.git
synced 2025-05-08 10:47:51 +00:00
29 lines
740 B
TypeScript
29 lines
740 B
TypeScript
import { defineConfig } from 'cypress';
|
|
import createBundler from '@bahmutov/cypress-esbuild-preprocessor';
|
|
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor';
|
|
import createEsbuildPlugin from '@badeball/cypress-cucumber-preprocessor/esbuild';
|
|
|
|
async function setupNodeEvents(
|
|
on: Cypress.PluginEvents,
|
|
config: Cypress.PluginConfigOptions
|
|
): Promise<Cypress.PluginConfigOptions> {
|
|
await addCucumberPreprocessorPlugin(on, config);
|
|
|
|
on(
|
|
'file:preprocessor',
|
|
createBundler({
|
|
plugins: [createEsbuildPlugin(config)]
|
|
})
|
|
);
|
|
|
|
return config;
|
|
}
|
|
|
|
export default defineConfig({
|
|
e2e: {
|
|
baseUrl: 'http://localhost:3000',
|
|
specPattern: '**/*.feature',
|
|
setupNodeEvents
|
|
}
|
|
});
|