From 87621fa80dfc049d515af9c4071d3763c18f1e5a Mon Sep 17 00:00:00 2001 From: Aditya Mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:39:01 +0530 Subject: [PATCH] tests: cleanup files for test failure (#9142) --- packages/projects/.gitignore | 1 + .../src/media/file-browser/file-browser.test.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 packages/projects/.gitignore diff --git a/packages/projects/.gitignore b/packages/projects/.gitignore new file mode 100644 index 0000000000..e37745539c --- /dev/null +++ b/packages/projects/.gitignore @@ -0,0 +1 @@ +test-* \ No newline at end of file diff --git a/packages/server-core/src/media/file-browser/file-browser.test.ts b/packages/server-core/src/media/file-browser/file-browser.test.ts index a3dc40aa3b..75c357468a 100644 --- a/packages/server-core/src/media/file-browser/file-browser.test.ts +++ b/packages/server-core/src/media/file-browser/file-browser.test.ts @@ -43,6 +43,13 @@ describe('file browser service', () => { app = createFeathersKoaApp() await app.setup() }) + after(async () => { + const directories = (await app.service(fileBrowserPath).find({ query: { directory: '/' } })).data.map( + (directory) => directory.key + ) + + await Promise.all(directories.map((directory) => app.service(fileBrowserPath).remove(directory))) + }) after(() => { return destroyEngine() }) @@ -230,7 +237,6 @@ describe('file browser service', () => { const foundIncrementedFile = directoryContents.data.filter( (file) => file.name.match(testFileName) && file.name.match('(1)') ) - assert.equal(foundIncrementedFile.length, 1) })