Cleanup after integration tests.

Running the tests repeatedly failed as the DB was left in an altered
state which interfered with the subsequent test invocation.

Remove the DB and generated config files after all the tests run.
pull/67/head
Jen Tak 2022-09-04 10:42:52 +02:00
parent 0e25b7ad6d
commit 8f9b344604
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,13 @@ const exec = util.promisify(require('child_process').exec);
jest.setTimeout(20000);
describe('Test the config-sync CLI', () => {
afterAll(async () => {
// Remove the generated files and the DB.
await exec('rm -rf config/sync');
await exec('rm -rf .tmp');
});
test('Export', async () => {
const { stdout } = await exec('yarn cs export -y');
expect(stdout).toContain('Finished export');