Skip to content

Commit 497fcf0

Browse files
committed
Test coverage
1 parent ca5c09d commit 497fcf0

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "qRemote",
33
"version": "3.8.34",
4-
"easBuild": true,
4+
"easBuild": true,
55
"main": "index.ts",
66
"scripts": {
77
"start": "expo start --dev-client",

tests/rn/components/ActionMenu.test.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ describe('ActionMenu', () => {
2929

3030
afterEach(() => {
3131
jest.clearAllMocks();
32+
// Tests that opt into fake timers must not leave them installed on
33+
// failure — an assertion throwing partway through a test body would
34+
// otherwise skip an inline `jest.useRealTimers()` cleanup at the end of
35+
// that test, leaking fake timers into every later test in this worker
36+
// process (surfacing as unrelated timer-based tests misbehaving, or the
37+
// worker failing to exit gracefully). afterEach always runs, so put
38+
// cleanup here instead of at the end of the test body.
39+
jest.clearAllTimers();
40+
jest.useRealTimers();
3241
Object.assign(mockInsets, { top: 0, bottom: 0, left: 0, right: 0 });
3342
});
3443

@@ -66,7 +75,6 @@ describe('ActionMenu', () => {
6675
jest.advanceTimersByTime(150);
6776
});
6877
expect(items[0].onPress).toHaveBeenCalledTimes(1);
69-
jest.useRealTimers();
7078
});
7179

7280
it('applies destructive styling path for destructive items without crashing', async () => {
@@ -200,7 +208,6 @@ describe('ActionMenu', () => {
200208
jest.advanceTimersByTime(150);
201209
});
202210
expect(items[0].onPress).toHaveBeenCalledTimes(1);
203-
jest.useRealTimers();
204211
});
205212
});
206213
});

0 commit comments

Comments
 (0)