Skip to content

Commit 3fcf04c

Browse files
committed
fix: dont use debug in CI
1 parent 5dcee1a commit 3fcf04c

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: deploy
22

33
on:
44
workflow_run:
5-
workflows: ['build and test']
5+
workflows: ['test']
66
types:
77
- completed
88

.github/workflows/build-and-test.yml renamed to .github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build and test
1+
name: test
22

33
on:
44
push:
@@ -27,4 +27,3 @@ jobs:
2727
- run: CHECK_LANGUAGES=true npm run test lang
2828
continue-on-error: true
2929
- run: npm run test
30-
- run: npm run build --if-present

src/test-setup.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ beforeEach(() => {
1010
setDomPreviewContext(expect.getState().currentTestName ?? 'initial');
1111
});
1212

13-
afterEach(() => {
14-
// Run dom-preview's debug if the test fails
15-
// if (context.task?.result?.state === 'fail') {
16-
debug();
17-
// }
18-
// Clean up react-testing-library. We need to manually do this because we
19-
// turn off the automatic teardown in the vite.config.
20-
// This needs to happen after dom-preview.
21-
cleanup();
22-
});
13+
const isCI = process.env.CI === 'true';
14+
15+
afterEach(
16+
isCI
17+
? () => {}
18+
: () => {
19+
// Run dom-preview's debug if the test fails
20+
// if (context.task?.result?.state === 'fail') {
21+
debug();
22+
// }
23+
// Clean up react-testing-library. We need to manually do this because we
24+
// turn off the automatic teardown in the vite.config.
25+
// This needs to happen after dom-preview.
26+
cleanup();
27+
},
28+
);

0 commit comments

Comments
 (0)