Skip to content

Commit d6e2639

Browse files
committed
update to work with types pkg
1 parent 107eb5c commit d6e2639

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
import { Layer } from 'expression-globals-typescript';
12
import { animate } from './index';
23

4+
// This let's Jest: ReferenceError: Cannot access before initialization
5+
// https://stackoverflow.com/questions/61157392/jest-mock-aws-sdk-referenceerror-cannot-access-before-initialization
6+
jest.mock('expression-globals-typescript', () => {
7+
const mLayer = { getItem: jest.fn().mockReturnThis(), promise: jest.fn() };
8+
return { Layer: jest.fn(() => mLayer) };
9+
});
10+
311
test('animates between default keys', () => {
412
expect(
513
animate(

0 commit comments

Comments
 (0)