From 549327c8850d05c9872efbf3903079c821681311 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Tue, 4 Aug 2020 11:17:44 +0100 Subject: [PATCH] reinstated jest config (removed accidently) --- packages/builder/package.json | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index e058873c18..30b9a2bdae 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -15,8 +15,39 @@ "cy:open": "cypress open", "cy:test": "start-server-and-test cy:setup http://localhost:4001/_builder cy:run" }, - "jest": { - "testEnvironment": "node" + "jest": { + "globals": { + "GLOBALS": { + "client": "web" + } + }, + "testURL": "http://jest-breaks-if-this-does-not-exist", + "moduleNameMapper": { + "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/internals/mocks/fileMock.js", + "\\.(css|less|sass|scss)$": "identity-obj-proxy", + "components(.*)$": "/src/components$1", + "builderStore(.*)$": "/src/builderStore$1" + }, + "moduleFileExtensions": [ + "js", + "svelte" + ], + "moduleDirectories": [ + "node_modules" + ], + "transform": { + "^.+js$": "babel-jest", + "^.+.svelte$": "svelte-jester" + }, + "transformIgnorePatterns": [ + "/node_modules/(?!svelte).+\\.js$" + ], + "modulePathIgnorePatterns": [ + "/cypress/" + ], + "setupFilesAfterEnv": [ + "@testing-library/jest-dom/extend-expect" + ] }, "eslintConfig": { "extends": [