From a4dc90ba93f4755cc3944cd6c2e55eda59682a02 Mon Sep 17 00:00:00 2001 From: Ben Kandelaars Date: Thu, 26 May 2022 10:53:55 +0100 Subject: [PATCH 1/3] Remove global jest import & allow in package.json --- package.json | 5 +++++ setup/placement.js | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 88ca1c7..e56b9a2 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,11 @@ }, "transformIgnorePatterns": [] }, + "healthier": { + "globals": [ + "jest" + ] + }, "devDependencies": { "@qubit/utils": "^1.1.0", "healthier": "^4.0.0", diff --git a/setup/placement.js b/setup/placement.js index d91d328..77f1beb 100644 --- a/setup/placement.js +++ b/setup/placement.js @@ -1,5 +1,4 @@ /* istanbul ignore file */ -const { jest } = require('@jest/globals') const Promise = require('sync-p/extra') const getBrowserState = require('@qubit/jolt/lib/getBrowserState') const addStylesheet = require('@qubit/add-stylesheet') From b3a55ec41e30c8fcf71a9e455d08abf7d5896223 Mon Sep 17 00:00:00 2001 From: Ben Kandelaars Date: Thu, 26 May 2022 10:56:06 +0100 Subject: [PATCH 2/3] Allow async await syntax --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index a9c29fa..c939e8f 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,7 @@ module.exports = { function transformJs (src) { return buble.transform(src, { transforms: { + asyncAwait: false, dangerousForOf: true, dangerousTaggedTemplateString: true }, From 54da2a1a1d50ebeeefc969bce4d3647a601cc84a Mon Sep 17 00:00:00 2001 From: Ben Kandelaars Date: Thu, 26 May 2022 10:57:04 +0100 Subject: [PATCH 3/3] Update readme to add jest environment config --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 215436a..c83d172 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ A jest transform to facilitate testing clientside implementations within the qub "test": "jest --coverage" }, "jest": { + "testEnvironment": "jsdom", "transform": { ".*(.js|.css|.less)$": "@qubit/jest" },