From 8f9b34460470ba9a14d2aed40ab3a2532e61e689 Mon Sep 17 00:00:00 2001 From: Jen Tak Date: Sun, 4 Sep 2022 10:42:52 +0200 Subject: [PATCH] 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. --- playground/__tests__/cli.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playground/__tests__/cli.test.js b/playground/__tests__/cli.test.js index b5b3b93..3379fd6 100644 --- a/playground/__tests__/cli.test.js +++ b/playground/__tests__/cli.test.js @@ -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');