Skip to content

Commit 2ff6350

Browse files
authored
Merge branch 'main' into feat/port-test-exception
2 parents aa4fe43 + 943ad7f commit 2ff6350

File tree

21 files changed

+1717
-25
lines changed

21 files changed

+1717
-25
lines changed

PORTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Tests covering the engine-specific part of Node-API, defined in `js_native_api.h
5151
| `test_bigint` | Ported ✅ | Easy |
5252
| `test_cannot_run_js` | Not ported | Medium |
5353
| `test_constructor` | Ported ✅ | Medium |
54-
| `test_conversions` | Not ported | Medium |
54+
| `test_conversions` | Ported ✅ | Medium |
5555
| `test_dataview` | Not ported | Medium |
5656
| `test_date` | Ported ✅ | Easy |
5757
| `test_error` | Ported ✅ | Medium |
@@ -69,7 +69,7 @@ Tests covering the engine-specific part of Node-API, defined in `js_native_api.h
6969
| `test_reference` | Not ported | Medium |
7070
| `test_reference_double_free` | Ported ✅ | Easy |
7171
| `test_sharedarraybuffer` | Not ported | Medium |
72-
| `test_string` | Not ported | Medium |
72+
| `test_string` | Ported ✅ | Medium |
7373
| `test_symbol` | Ported ✅ | Easy |
7474
| `test_typedarray` | Ported ✅ | Medium |
7575

eslint.config.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { defineConfig, globalIgnores } from "eslint/config";
22
import globals from "globals";
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
35

46
export default defineConfig([
5-
globalIgnores(["node"]),
7+
globalIgnores(["**/CMakeFiles/**"]),
8+
eslint.configs.recommended,
9+
tseslint.configs.recommended,
610
{
7-
files: ["tests/**/*.js"],
11+
files: [
12+
"tests/**/*.js",
13+
],
814
languageOptions: {
915
// Only allow ECMAScript built-ins and CTS harness globals.
1016
// This causes no-undef to flag any runtime-specific API (setTimeout, process, Buffer, etc.).
@@ -18,6 +24,8 @@ export default defineConfig([
1824
gcUntil: "readonly",
1925
spawnTest: "readonly",
2026
experimentalFeatures: "readonly",
27+
napiVersion: "readonly",
28+
skipTest: "readonly",
2129
},
2230
},
2331
rules: {
@@ -31,4 +39,16 @@ export default defineConfig([
3139
],
3240
},
3341
},
42+
{
43+
files: [
44+
"implementors/**/*.{js,ts}",
45+
"scripts/**/*.{js,mjs}",
46+
],
47+
languageOptions: {
48+
globals: {
49+
...globals.es2025,
50+
...globals.node,
51+
},
52+
},
53+
},
3454
]);

implementors/node/features.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ globalThis.experimentalFeatures = {
77
setPrototype: true,
88
postFinalizer: true,
99
};
10+
11+
globalThis.napiVersion = Number(process.versions.napi);
12+
13+
globalThis.skipTest = () => {
14+
process.exit(0);
15+
};

implementors/node/run-tests.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ import { listDirectoryEntries, runFileInSubprocess } from "./tests.ts";
66
const ROOT_PATH = path.resolve(import.meta.dirname, "..", "..");
77
const TESTS_ROOT_PATH = path.join(ROOT_PATH, "tests");
88

9-
const ASSERT_MODULE_PATH = path.join(
10-
ROOT_PATH,
11-
"implementors",
12-
"node",
13-
"assert.js"
14-
);
15-
const LOAD_ADDON_MODULE_PATH = path.join(
16-
ROOT_PATH,
17-
"implementors",
18-
"node",
19-
"load-addon.js"
20-
);
21-
229
async function populateSuite(
2310
testContext: TestContext,
2411
dir: string

0 commit comments

Comments
 (0)