-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve test space deletion (#1480)
* chore: improve test space deletion
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import { after } from 'mocha' | ||
import { before, after } from 'mocha' | ||
import { cleanupTestSpaces } from './helpers' | ||
|
||
after('clean up test spaces', async () => { | ||
const housekeeping = async () => { | ||
try { | ||
await cleanupTestSpaces() | ||
} catch { | ||
// ignore if the cleanup fails. Usually fails locally due to missing credentials | ||
} catch (err) { | ||
if (err.message === 'Missing credential') { | ||
console.log('Skipped deletion of old test spaces due to missing credentials.') | ||
} else { | ||
console.log('Skipped deletion of old test spaces. Error:', err.message) | ||
} | ||
} | ||
} | ||
|
||
before('clean up test spaces', async () => { | ||
await housekeeping() | ||
console.log('Running tests...') | ||
}) | ||
|
||
after('clean up test spaces', async () => { | ||
await housekeeping() | ||
}) |