Skip to content

Commit 6b9020e

Browse files
authored
Merge branch 'main' into feat/port-test-sharedarraybuffer
2 parents ece4e69 + 943ad7f commit 6b9020e

21 files changed

Lines changed: 1715 additions & 25 deletions

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` | 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: 20 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.).
@@ -32,4 +38,16 @@ export default defineConfig([
3238
],
3339
},
3440
},
41+
{
42+
files: [
43+
"implementors/**/*.{js,ts}",
44+
"scripts/**/*.{js,mjs}",
45+
],
46+
languageOptions: {
47+
globals: {
48+
...globals.es2025,
49+
...globals.node,
50+
},
51+
},
52+
},
3553
]);

implementors/node/features.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ globalThis.experimentalFeatures = {
1313
setPrototype: true,
1414
postFinalizer: true,
1515
};
16+
17+
globalThis.napiVersion = Number(process.versions.napi);
18+
19+
globalThis.skipTest = () => {
20+
process.exit(0);
21+
};

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)