-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.js
More file actions
43 lines (38 loc) · 1.16 KB
/
Copy pathcypress.config.js
File metadata and controls
43 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { defineConfig } = require("cypress");
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const {
addCucumberPreprocessorPlugin,
} = require("@badeball/cypress-cucumber-preprocessor");
const {
createEsbuildPlugin,
} = require("@badeball/cypress-cucumber-preprocessor/esbuild");
const DB = require("./cypress/plugins/db");
const MockResend = require("./cypress/plugins/mockresend");
module.exports = defineConfig({
projectId: "nxmvpu",
e2e: {
baseUrl: "http://127.0.0.1:8000",
specPattern: "cypress/e2e/**/*.feature",
async setupNodeEvents(on, config) {
// Cucumber preprocessor
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
// Custom tasks from old plugins/index.js
const db = new DB();
const resend = new MockResend(9991);
on("task", {
resetDb: db.resetDb,
addUsers: db.addUsers,
addStories: db.addStories,
listenForEmails: resend.listenForEmails,
getEmails: resend.getEmails,
});
return config;
},
},
});