From 097a342b058886e85759ad70ed3929d08b5f00a6 Mon Sep 17 00:00:00 2001 From: Demian Leon Florin <74616552+florind12@users.noreply.github.com> Date: Wed, 13 Oct 2021 15:24:29 +0300 Subject: [PATCH] fix: [ACNA-1369] aio app delete action doesn't delete the action e2e test (#490) --- .gitignore | 2 +- src/commands/app/delete/action.js | 2 +- test/commands/app/delete/action.test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fc352efa..f6001f10 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ node_modules coverage .vscode/ -/.idea/ +.idea/ oclif.manifest.json package-lock.json diff --git a/src/commands/app/delete/action.js b/src/commands/app/delete/action.js index cc3e324b..0d7a924a 100644 --- a/src/commands/app/delete/action.js +++ b/src/commands/app/delete/action.js @@ -87,7 +87,7 @@ class DeleteActionCommand extends BaseCommand { // NOTE: (attempt) to delete test files. The test file must match the action name // file in the same folder, which is true in most cases, but won't work for asset compute action tests for example. try { - const pathToE2eTests = path.join(action.e2eTestsDir, action.actionName + '.e2e.js') + const pathToE2eTests = path.join(action.e2eTestsDir, action.actionName + '.e2e.test.js') const pathToUnitTests = path.join(action.unitTestsDir, action.actionName + '.test.js') fs.removeSync(pathToE2eTests) aioLogger.debug(`deleted '${pathToE2eTests}'`) diff --git a/test/commands/app/delete/action.test.js b/test/commands/app/delete/action.test.js index 738aba32..b58ff55a 100644 --- a/test/commands/app/delete/action.test.js +++ b/test/commands/app/delete/action.test.js @@ -219,12 +219,12 @@ describe('good flags', () => { } await command.run() expect(fs.removeSync).toHaveBeenCalledWith('a-path') - expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('A/e2e/tests/dir/a-fileName.e2e.js')) + expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('A/e2e/tests/dir/a-fileName.e2e.test.js')) expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('A/unit/tests/dir/a-fileName.test.js')) // expect(command.log).toHaveBeenCalledWith('✔ Deleted \'a\'') expect(fs.removeSync).toHaveBeenCalledWith('b-path') - expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('B/e2e/tests/dir/b-fileName.e2e.js')) + expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('B/e2e/tests/dir/b-fileName.e2e.test.js')) expect(fs.removeSync).toHaveBeenCalledWith(path.normalize('B/unit/tests/dir/b-fileName.test.js')) // expect(command.log).toHaveBeenCalledWith('✔ Deleted \'b\'') })