From 5f92f3d78e6f7fe15268d0c6b7fe1e478392a2c6 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Wed, 9 Feb 2022 20:22:16 +0000 Subject: [PATCH] test: Adds workaround for package exports (Jest will only support package exports in version 28: https://github.com/facebook/jest/pull/11961) --- package.json | 5 ++++- src/blocks/literals/Unit.ts | 4 ++-- src/tests/routing.test.ts | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2e27bb9..33a6c67 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,10 @@ "/src/**/*.{spec,test}.{js,jsx,ts,tsx}" ], "moduleNameMapper": { - "react-markdown": "/node_modules/react-markdown/react-markdown.min.js" + "react-markdown": "/node_modules/react-markdown/react-markdown.min.js", + "@tezwell/michelson-sdk/converter": "@tezwell/michelson-sdk/converter/index.cjs", + "@tezwell/michelson-sdk/literal": "@tezwell/michelson-sdk/literal.cjs", + "@tezwell/michelson-sdk/type": "@tezwell/michelson-sdk/type.cjs" } }, "eslintConfig": { diff --git a/src/blocks/literals/Unit.ts b/src/blocks/literals/Unit.ts index b1fdcc8..6002fed 100644 --- a/src/blocks/literals/Unit.ts +++ b/src/blocks/literals/Unit.ts @@ -1,9 +1,9 @@ import Blockly from 'blockly'; -import MichelsonLiteral from '@tezwell/michelson-sdk/literal'; -import MichelsonType from '@tezwell/michelson-sdk/type'; import SmartTSTypes from '@tezwell/smartts-sdk/core/type'; import SmartTSLiterals from '@tezwell/smartts-sdk/core/literal'; +import MichelsonType from '@tezwell/michelson-sdk/type'; +import MichelsonLiteral from '@tezwell/michelson-sdk/literal'; import SmartML from '../generators/SmartML'; import BlockKind from '../enums/BlockKind'; import Michelson from '../generators/Michelson'; diff --git a/src/tests/routing.test.ts b/src/tests/routing.test.ts index a6c8491..4c4354e 100644 --- a/src/tests/routing.test.ts +++ b/src/tests/routing.test.ts @@ -19,8 +19,7 @@ describe('Application Routing', () => { await renderWithRouter({ path, }); - - await waitFor(() => expect(document.title).toMatch(route.title)); + await waitFor(async () => expect(document.title).toMatch(route.title)); }); }); });