File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,6 @@ describe('Sidebar', () => {
30
30
let fakeSendErrorsTo ;
31
31
let fakeEmitter ;
32
32
33
- beforeAll ( ( ) => {
34
- // Make `requestAnimationFrame` invoke its callback synchronously. rAF is
35
- // used to debounce some internal actions.
36
- sinon . stub ( window , 'requestAnimationFrame' ) . yields ( ) ;
37
- } ) ;
38
-
39
- afterAll ( ( ) => {
40
- window . requestAnimationFrame . restore ( ) ;
41
- } ) ;
42
-
43
33
// Helpers for getting the channels used for host <-> guest/sidebar communication.
44
34
// These currently rely on knowing the implementation detail of which order
45
35
// the channels are created in.
@@ -132,6 +122,10 @@ describe('Sidebar', () => {
132
122
} ;
133
123
134
124
beforeEach ( ( ) => {
125
+ // Make `requestAnimationFrame` invoke its callback synchronously. rAF is
126
+ // used to debounce some internal actions.
127
+ sinon . stub ( window , 'requestAnimationFrame' ) . yields ( ) ;
128
+
135
129
sidebars = [ ] ;
136
130
containers = [ ] ;
137
131
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ globalThis.context ??= globalThis.describe;
19
19
// Configure Enzyme for UI tests.
20
20
configure ( { adapter : new Adapter ( ) } ) ;
21
21
22
- // Unmount all UI components after each test.
23
22
afterEach ( ( ) => {
23
+ // Unmount all UI components after each test.
24
24
unmountAll ( ) ;
25
+ // Restore all created mocks during a test, to free-up memory
26
+ sinon . restore ( ) ;
25
27
} ) ;
You can’t perform that action at this time.
0 commit comments