forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
46 lines (40 loc) · 1.31 KB
/
cypress.config.js
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
44
45
46
const { execSync } = require('child_process');
const { existsSync } = require('fs');
const { defineConfig } = require('cypress');
function seed(args = []) {
return execSync('node tools/scripts/seed/seed-demo-user ' + args.join(' '));
}
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:8000',
projectId: 'ke77ns',
retries: 4,
chromeWebSecurity: false,
// This is the default spec pattern, that we use on /learn proper
//
// For special ones like the third- party or the mobile app specs,
// you can use the below command:
//
// pnpm run cypress:dev:run -- --spec "cypress/e2e/mobile-learn/**/*"
// pnpm run cypress:dev:run -- --spec "cypress/e2e/third-party/**/*"
//
// and so on.
//
specPattern: ['cypress/e2e/default/**/*.js', 'cypress/e2e/default/**/*.ts'],
// Temporary disable these until we can address the flakiness
excludeSpecPattern: ['cypress/e2e/**/challenge-hot-keys.ts'],
setupNodeEvents(on, config) {
config.env = config.env || {};
on('before:run', () => {
if (!existsSync('./shared/config/curriculum.json')) {
execSync('pnpm run build:curriculum');
}
});
on('task', {
seed
});
config.env.API_LOCATION = 'http://localhost:3000';
return config;
}
}
});