diff --git a/jest.config.js b/jest.config.js index 3c080fa6d..63c2e1b35 100644 --- a/jest.config.js +++ b/jest.config.js @@ -40,6 +40,7 @@ module.exports = { ], testEnvironment: 'node', globalSetup: '/test/util/SetupTests.ts', + globalTeardown: '/test/util/TeardownTests.ts', setupFilesAfterEnv: [ 'jest-rdf' ], collectCoverage: false, // See https://github.com/matthieubosquet/ts-dpop/issues/13 diff --git a/test/util/TeardownTests.ts b/test/util/TeardownTests.ts new file mode 100644 index 000000000..69d376b79 --- /dev/null +++ b/test/util/TeardownTests.ts @@ -0,0 +1,7 @@ +import { getTestFolder, removeFolder } from '../integration/Config'; + +// Jest global teardown requires a single function to be exported +export default async function(): Promise { + // Clean up the root test folder + await removeFolder(getTestFolder('')); +}