Skip to content

Commit

Permalink
fix: [ACNA-1369] aio app delete action doesn't delete the action e2e …
Browse files Browse the repository at this point in the history
…test (#490)
  • Loading branch information
florind-ens authored Oct 13, 2021
1 parent 03a7722 commit 097a342
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
node_modules
coverage
.vscode/
/.idea/
.idea/

oclif.manifest.json
package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion src/commands/app/delete/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`)
Expand Down
4 changes: 2 additions & 2 deletions test/commands/app/delete/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\'')
})
Expand Down

0 comments on commit 097a342

Please sign in to comment.