Skip to content

Commit

Permalink
fix(test-utils): return promise from lifecycle (#9331)
Browse files Browse the repository at this point in the history
### Description

From Jest docs
([here](https://jestjs.io/docs/setup-teardown#repeating-setup))

> beforeEach and afterEach can handle asynchronous code in the same ways
that [tests can handle asynchronous
code](https://jestjs.io/docs/asynchronous) - they can either take a done
parameter or return a promise

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
tknickman authored Oct 24, 2024
1 parent be0f18a commit 2d5200f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/turbo-test-utils/src/useFixtures.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export function setupTestFixtures({
const parentDirectory = path.join(directory, test ? test : randomUUID());

afterEach(async () => {
await Promise.all(
return Promise.all(
fixtures.map((fixture) =>
rm(fixture, {
retryDelay: 50,
@@ -41,7 +41,7 @@ export function setupTestFixtures({
});

afterAll(async () => {
await rm(parentDirectory, {
return rm(parentDirectory, {
retryDelay: 50,
maxRetries: 5,
recursive: true,

0 comments on commit 2d5200f

Please sign in to comment.