From 4579f14de5a0a29698744d6584fab16cfc5e9c00 Mon Sep 17 00:00:00 2001 From: Antonio Barcelos Date: Tue, 4 Apr 2023 16:26:31 +0200 Subject: [PATCH] Enables Deno specific tests in Core Core features which are environment dependent will need to be implemented. For testing this features, environment dependent tests need to be setup. The `deno` tests can be run by `npm run test::deno` and they need to be located under `./packages/core/test/deno`. The testkit pipeline is configured to run these tests only when configured for test `deno`. --- package.json | 1 + packages/core/jest.config.ts | 7 ++++--- packages/core/package.json | 1 + packages/core/test/deno/.gitkeep | 0 testkit/unittests.py | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 packages/core/test/deno/.gitkeep diff --git a/package.json b/package.json index f34bc042f..d97175a53 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "build::notci": "lerna bootstrap", "docs": "lerna run docs --stream --concurrency 1", "test::unit": "lerna run test::unit --stream", + "test::deno": "lerna run test::deno --stream", "test::integration": "lerna run test::integration --stream", "test::browser": "lerna run test::browser --stream", "test::stress": "lerna run test::stress --stream", diff --git a/packages/core/jest.config.ts b/packages/core/jest.config.ts index 538508c09..b717b2106 100644 --- a/packages/core/jest.config.ts +++ b/packages/core/jest.config.ts @@ -152,9 +152,10 @@ export default { // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped - // testPathIgnorePatterns: [ - // "/node_modules/" - // ], + testPathIgnorePatterns: [ + "/node_modules/", + "/test/deno/" + ], // The regexp pattern or array of patterns that Jest uses to detect test files // testRegex: [], diff --git a/packages/core/package.json b/packages/core/package.json index 67bc6a123..175b0198e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -10,6 +10,7 @@ "test": "jest", "test::watch": "jest --watch", "test::unit": "npm run test", + "test::deno": "deno test --allow-none ./test/deno/", "predocs": "npm run build && npm run build::es6", "docs": "esdoc -c esdoc.json", "prepare": "npm run build", diff --git a/packages/core/test/deno/.gitkeep b/packages/core/test/deno/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/testkit/unittests.py b/testkit/unittests.py index 791590a7c..9ae1753a9 100644 --- a/testkit/unittests.py +++ b/testkit/unittests.py @@ -14,3 +14,6 @@ run_in_driver_repo(["npm", "run", "lint"]) run_in_driver_repo(["npm", "run", "test::unit", "--", ignore]) + + if is_deno(): + run_in_driver_repo(["npm" "run", "test::deno"])