mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
fix tests
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
const { defineConfig } = require('cypress');
|
||||
const killPort = require('kill-port');
|
||||
const { clearDataWithBackup } = require('./e2eTestTools');
|
||||
const waitOn = require('wait-on');
|
||||
const { exec } = require('child_process');
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
@@ -7,8 +10,19 @@ module.exports = defineConfig({
|
||||
// implement node event listeners here
|
||||
|
||||
on('before:spec', async details => {
|
||||
clearDataWithBackup();
|
||||
// await axios.default.post('http://localhost:3000/connections/reload-connection-list', {});
|
||||
await clearDataWithBackup();
|
||||
|
||||
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());
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user