mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 11:26:00 +00:00
30 lines
860 B
JavaScript
30 lines
860 B
JavaScript
const { defineConfig } = require('cypress');
|
|
const killPort = require('kill-port');
|
|
const { clearTestingData } = require('./e2eTestTools');
|
|
const waitOn = require('wait-on');
|
|
const { exec } = require('child_process');
|
|
|
|
module.exports = defineConfig({
|
|
e2e: {
|
|
setupNodeEvents(on, config) {
|
|
// implement node event listeners here
|
|
|
|
on('before:spec', async details => {
|
|
await clearTestingData();
|
|
|
|
if (config.isInteractive) {
|
|
await killPort(3000);
|
|
serverProcess = exec('yarn start');
|
|
await waitOn({ resources: ['http://localhost:3000'] });
|
|
serverProcess.stdout.on('data', data => {
|
|
console.log(data.toString());
|
|
});
|
|
serverProcess.stderr.on('data', data => {
|
|
console.error(data.toString());
|
|
});
|
|
}
|
|
});
|
|
},
|
|
},
|
|
});
|