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', () => {
3030 let fakeSendErrorsTo ;
3131 let fakeEmitter ;
3232
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-
4333 // Helpers for getting the channels used for host <-> guest/sidebar communication.
4434 // These currently rely on knowing the implementation detail of which order
4535 // the channels are created in.
@@ -132,6 +122,10 @@ describe('Sidebar', () => {
132122 } ;
133123
134124 beforeEach ( ( ) => {
125+ // Make `requestAnimationFrame` invoke its callback synchronously. rAF is
126+ // used to debounce some internal actions.
127+ sinon . stub ( window , 'requestAnimationFrame' ) . yields ( ) ;
128+
135129 sidebars = [ ] ;
136130 containers = [ ] ;
137131
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ globalThis.context ??= globalThis.describe;
1919// Configure Enzyme for UI tests.
2020configure ( { adapter : new Adapter ( ) } ) ;
2121
22- // Unmount all UI components after each test.
2322afterEach ( ( ) => {
23+ // Unmount all UI components after each test.
2424 unmountAll ( ) ;
25+ // Restore all created mocks during a test, to release memory
26+ sinon . restore ( ) ;
2527} ) ;
You can’t perform that action at this time.
0 commit comments