From 32df7b18bc5b7fd9d268fe457352b885f2f68149 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 22 Jul 2021 11:41:37 +0200 Subject: Data used by tests now in /tmp/nodegit_test & added test teardown script --- jest.config.js | 3 ++- package.json | 2 +- test/teardown.ts | 5 +++++ test/test.env | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 test/teardown.ts diff --git a/jest.config.js b/jest.config.js index b541da5..41f1c01 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,6 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', - globalSetup: "./test/setup.ts" + globalSetup: "./test/setup.ts", + globalTeardown: "./test/teardown.ts" }; \ No newline at end of file diff --git a/package.json b/package.json index 85bf0f2..0bf51d9 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "HampusMat", "private": true, "scripts": { - "clean": "rm -rf node_modules git packages/*/node_modules packages/client/dist", + "clean": "rm -rf node_modules packages/*/node_modules packages/client/dist", "dev": "concurrently -k --kill-others-on-fail \"cd packages/client && yarn serve\" \"cd packages/server && yarn dev\"", "build": "cd packages/client && yarn build", "start": "ts-node packages/server/src/app.ts", diff --git a/test/teardown.ts b/test/teardown.ts new file mode 100644 index 0000000..3712af2 --- /dev/null +++ b/test/teardown.ts @@ -0,0 +1,5 @@ +import { remove } from "fs-extra"; + +export default async function teardown() { + await remove(process.env.BASE_DIR); +} \ No newline at end of file diff --git a/test/test.env b/test/test.env index 2742aac..42ff7dd 100644 --- a/test/test.env +++ b/test/test.env @@ -1,4 +1,4 @@ -BASE_DIR=git +BASE_DIR=/tmp/nodegit_test AVAIL_REPO=githermit.git AVAIL_REPO_URL=https://gitlab.com/HampusMat/githermit.git UNAVAIL_REPO=angular -- cgit v1.2.3-18-g5258