mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
test fixes
This commit is contained in:
@@ -1,34 +1,14 @@
|
||||
const { defineConfig } = require('cypress');
|
||||
const { clearDataWithBackup } = require('./e2eTestTools');
|
||||
const { exec } = require('child_process');
|
||||
const waitOn = require('wait-on');
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
// implement node event listeners here
|
||||
let serverProcess;
|
||||
|
||||
on('before:spec', async details => {
|
||||
console.log('******** BEFORE RUN ****************');
|
||||
clearDataWithBackup();
|
||||
|
||||
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());
|
||||
});
|
||||
});
|
||||
|
||||
on('after:spec', () => {
|
||||
console.log('******** AFTER RUN ****************', serverProcess);
|
||||
if (serverProcess) {
|
||||
console.log('Stopping local server...');
|
||||
serverProcess.kill();
|
||||
}
|
||||
// await axios.default.post('http://localhost:3000/connections/reload-connection-list', {});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user