diff --git a/eslint-local-rules/index.js b/eslint-local-rules/index.js index 177b0a129c..202e52e70e 100644 --- a/eslint-local-rules/index.js +++ b/eslint-local-rules/index.js @@ -7,11 +7,12 @@ module.exports = { if ( /^@budibase\/[^/]+\/.*$/.test(importPath) && - importPath !== "@budibase/backend-core/tests" + importPath !== "@budibase/backend-core/tests" && + importPath !== "@budibase/string-templates/test/utils" ) { context.report({ node, - message: `Importing from @budibase is not allowed, except for @budibase/backend-core/tests.`, + message: `Importing from @budibase is not allowed, except for @budibase/backend-core/tests and @budibase/string-templates/test/utils.`, }) } }, diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index fbc5167853..6c6d6a20d3 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -30,6 +30,7 @@ const baseConfig: Config.InitialProjectOptions = { "@budibase/backend-core": "/../backend-core/src", "@budibase/shared-core": "/../shared-core/src", "@budibase/types": "/../types/src", + "@budibase/string-templates/(.*)": ["/../string-templates/$1"], "@budibase/string-templates": ["/../string-templates/src"], }, } diff --git a/packages/server/src/jsRunner/tests/jsRunner.spec.ts b/packages/server/src/jsRunner/tests/jsRunner.spec.ts index 54983aa470..dc6e32f52c 100644 --- a/packages/server/src/jsRunner/tests/jsRunner.spec.ts +++ b/packages/server/src/jsRunner/tests/jsRunner.spec.ts @@ -1,7 +1,7 @@ import { validate as isValidUUID } from "uuid" import { processStringSync, encodeJSBinding } from "@budibase/string-templates" -const { runJsHelpersTests } = require("@budibase/string-templates/test/utils") +import { runJsHelpersTests } from "@budibase/string-templates/test/utils" import tk from "timekeeper" import { init } from ".." diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 4a92a25150..aa3aa5adec 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -12,7 +12,6 @@ "import": "./dist/bundle.mjs" }, "./package.json": "./package.json", - "./test/utils": "./test/utils.ts", "./iife": "./src/iife.js" }, "files": [