From 280500d0912961e7e9cae241a9c475fed71ebeba Mon Sep 17 00:00:00 2001 From: Balakrishna Avulapati Date: Thu, 9 Apr 2026 17:28:32 +0530 Subject: [PATCH] add napiVersion and skipTest harness globals and remove unused imports --- eslint.config.js | 2 ++ implementors/node/features.js | 6 ++++++ implementors/node/run-tests.ts | 13 ------------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index fff73c6..e02a875 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,6 +17,8 @@ export default defineConfig([ mustNotCall: "readonly", gcUntil: "readonly", experimentalFeatures: "readonly", + napiVersion: "readonly", + skipTest: "readonly", }, }, rules: { diff --git a/implementors/node/features.js b/implementors/node/features.js index d06bad9..27286f8 100644 --- a/implementors/node/features.js +++ b/implementors/node/features.js @@ -7,3 +7,9 @@ globalThis.experimentalFeatures = { setPrototype: true, postFinalizer: true, }; + +globalThis.napiVersion = Number(process.versions.napi); + +globalThis.skipTest = () => { + process.exit(0); +}; diff --git a/implementors/node/run-tests.ts b/implementors/node/run-tests.ts index ce83184..1d341b7 100644 --- a/implementors/node/run-tests.ts +++ b/implementors/node/run-tests.ts @@ -6,19 +6,6 @@ import { listDirectoryEntries, runFileInSubprocess } from "./tests.ts"; const ROOT_PATH = path.resolve(import.meta.dirname, "..", ".."); const TESTS_ROOT_PATH = path.join(ROOT_PATH, "tests"); -const ASSERT_MODULE_PATH = path.join( - ROOT_PATH, - "implementors", - "node", - "assert.js" -); -const LOAD_ADDON_MODULE_PATH = path.join( - ROOT_PATH, - "implementors", - "node", - "load-addon.js" -); - async function populateSuite( testContext: TestContext, dir: string