Skip to content

Commit

Permalink
feat(testing): Configure jest to ignore sidecar files in __tests__ fo…
Browse files Browse the repository at this point in the history
…lder (#11108)

Solves for #10870

### Description:
`./api` directory structure:
<img width="438" alt="image"
src="https://github.com/user-attachments/assets/932e78a8-e105-4a98-a67e-3e71e292f325">
`./web` directory structure:
<img width="594" alt="image"
src="https://github.com/user-attachments/assets/00a12bde-c7dd-4ef5-a6c5-bb403cbde2e0">



Before: 

`yarn rw test api`:
<img width="772" alt="image"
src="https://github.com/user-attachments/assets/1ccbe49a-7702-4134-b07b-cc4a0ad1cce9">

`yarn rw test web`:
<img width="1170" alt="image"
src="https://github.com/user-attachments/assets/814c987b-f562-43cd-a3e2-08ab2ddf0b15">



After:
`yarn rw test api`:
<img width="778" alt="image"
src="https://github.com/user-attachments/assets/55c6b352-1c3c-487c-b7a0-df64b56eda60">

`yarn rw test web`:
<img width="1168" alt="image"
src="https://github.com/user-attachments/assets/e96d7423-826c-4987-8d81-de12f376ff31">

---------

Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
  • Loading branch information
V1shvesh and dac09 committed Jul 30, 2024
1 parent 4122964 commit 115911d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .changesets/11108.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- feat(testing): Configure jest to ignore sidecar files in __tests__ folder (#11108) by @V1shvesh

Solves for #10870

### Description:
`./api` directory structure:
<img width="438" alt="image" src="https://github.com/user-attachments/assets/932e78a8-e105-4a98-a67e-3e71e292f325">
`./web` directory structure:
<img width="594" alt="image" src="https://github.com/user-attachments/assets/00a12bde-c7dd-4ef5-a6c5-bb403cbde2e0">



Before:

`yarn rw test api`:
<img width="772" alt="image" src="https://github.com/user-attachments/assets/1ccbe49a-7702-4134-b07b-cc4a0ad1cce9">

`yarn rw test web`:
<img width="1170" alt="image" src="https://github.com/user-attachments/assets/814c987b-f562-43cd-a3e2-08ab2ddf0b15">



After:
`yarn rw test api`:
<img width="778" alt="image" src="https://github.com/user-attachments/assets/55c6b352-1c3c-487c-b7a0-df64b56eda60">

`yarn rw test web`:
<img width="1168" alt="image" src="https://github.com/user-attachments/assets/e96d7423-826c-4987-8d81-de12f376ff31">

1 change: 1 addition & 0 deletions packages/testing/config/jest/api/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ module.exports = {
},
],
},
testPathIgnorePatterns: ['.scenarios.[jt]s$'],
}
1 change: 1 addition & 0 deletions packages/testing/config/jest/web/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ module.exports = {
],
},
resolver: path.resolve(__dirname, './resolver.js'),
testPathIgnorePatterns: ['.(stories|mock).[jt]sx?$'],
}

0 comments on commit 115911d

Please sign in to comment.