Skip to content

Commit 3f690b4

Browse files
committed
Fix false-positive snapshot mismatch
Same reason why jest can fail with "could not find all inline snapshots". Since we don't need "done()" on async tests we can safely remove it.
1 parent 300d3f2 commit 3f690b4

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

packages/react-devtools-shared/src/__tests__/inspectedElement-test.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ describe('InspectedElement', () => {
11681168
done();
11691169
});
11701170

1171-
it('should not dehydrate nested values until explicitly requested', async done => {
1171+
it('should not dehydrate nested values until explicitly requested', async () => {
11721172
const Example = () => {
11731173
const [state] = React.useState({
11741174
foo: {
@@ -1354,11 +1354,9 @@ describe('InspectedElement', () => {
13541354
},
13551355
]
13561356
`);
1357-
1358-
done();
13591357
});
13601358

1361-
it('should dehydrate complex nested values when requested', async done => {
1359+
it('should dehydrate complex nested values when requested', async () => {
13621360
const Example = () => null;
13631361

13641362
const container = document.createElement('div');
@@ -1446,11 +1444,9 @@ describe('InspectedElement', () => {
14461444
},
14471445
}
14481446
`);
1449-
1450-
done();
14511447
});
14521448

1453-
it('should include updates for nested values that were previously hydrated', async done => {
1449+
it('should include updates for nested values that were previously hydrated', async () => {
14541450
const Example = () => null;
14551451

14561452
const container = document.createElement('div');
@@ -1637,11 +1633,9 @@ describe('InspectedElement', () => {
16371633
},
16381634
}
16391635
`);
1640-
1641-
done();
16421636
});
16431637

1644-
it('should not tear if hydration is requested after an update', async done => {
1638+
it('should not tear if hydration is requested after an update', async () => {
16451639
const Example = () => null;
16461640

16471641
const container = document.createElement('div');
@@ -1748,8 +1742,6 @@ describe('InspectedElement', () => {
17481742
},
17491743
}
17501744
`);
1751-
1752-
done();
17531745
});
17541746

17551747
it('should inspect hooks for components that only use context', async done => {

packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('InspectedElementContext', () => {
143143
done();
144144
});
145145

146-
it('should support complex data types', async done => {
146+
it('should support complex data types', async () => {
147147
const Immutable = require('immutable');
148148

149149
const Example = () => null;
@@ -241,8 +241,8 @@ describe('InspectedElementContext', () => {
241241
"preview_long": DataView(3),
242242
},
243243
"date": Dehydrated {
244-
"preview_short": Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Standard Time),
245-
"preview_long": Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Standard Time),
244+
"preview_short": Thu Jan 01 1970 01:00:00 GMT+0100 (Central European Standard Time),
245+
"preview_long": Thu Jan 01 1970 01:00:00 GMT+0100 (Central European Standard Time),
246246
},
247247
"fn": Dehydrated {
248248
"preview_short": ƒ exampleFunction() {},
@@ -325,8 +325,6 @@ describe('InspectedElementContext', () => {
325325
},
326326
}
327327
`);
328-
329-
done();
330328
});
331329

332330
it('should support objects with no prototype', async done => {
@@ -574,7 +572,7 @@ describe('InspectedElementContext', () => {
574572
done();
575573
});
576574

577-
it('should not dehydrate nested values until explicitly requested', async done => {
575+
it('should not dehydrate nested values until explicitly requested', async () => {
578576
const Example = () => null;
579577

580578
act(() =>
@@ -670,8 +668,6 @@ describe('InspectedElementContext', () => {
670668
},
671669
}
672670
`);
673-
674-
done();
675671
});
676672

677673
it('should enable inspected values to be stored as global variables', () => {

0 commit comments

Comments
 (0)