mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix <Extensions> tests by removing mockFs and making everything injectable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
46db3a6b7a
commit
69bd42357f
39 files changed
+483
-189
No files matched your search
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mock the global window variable
|
||||
*/
|
||||
export function mockWindow() {
|
||||
Object.defineProperty(window, "requestIdleCallback", {
|
||||
writable: true,
|
||||
value: jest.fn().mockImplementation(callback => callback()),
|
||||
});
|
||||
|
||||
Object.defineProperty(window, "cancelIdleCallback", {
|
||||
writable: true,
|
||||
value: jest.fn(),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user