Node tests non-functional #3

Open
opened 2026-07-02 09:52:45 +10:00 by mnpx · 0 comments
Owner

Description

Tests do not seem to function. This has been happening since at least 85eadbbca2.

Reproduce

  1. npm i
  2. npm test

Logs

> tree-sitter-wikitext@0.0.0 test
> tsc && node --test bindings/node/*_test.js

✖ can load grammar (2.358562ms)
ℹ tests 1
ℹ suites 0
ℹ pass 0
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 49.097844

✖ failing tests:

test at bindings/node/binding_test.js:6:1
✖ can load grammar (2.358562ms)
  AssertionError [ERR_ASSERTION]: Got unwanted exception.
  Actual message: "Cannot read properties of undefined (reading 'length')"
      at TestContext.<anonymous> (<wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:10)
      at Test.runInAsyncScope (node:async_hooks:214:14)
      at Test.run (node:internal/test_runner/test:1047:25)
      at Test.start (node:internal/test_runner/test:944:17)
      at startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: TypeError: Cannot read properties of undefined (reading 'length')
        at initializeLanguageNodeClasses (<wikitext dir redacted for forgejo issue>/node_modules/tree-sitter/index.js:858:42)
        at Parser.setLanguage (<wikitext dir redacted for forgejo issue>/node_modules/tree-sitter/index.js:355:5)
        at <wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:36
        at getActual (node:assert:530:5)
        at Function.doesNotThrow (node:assert:696:32)
        at TestContext.<anonymous> (<wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:10)
        at Test.runInAsyncScope (node:async_hooks:214:14)
        at Test.run (node:internal/test_runner/test:1047:25)
        at Test.start (node:internal/test_runner/test:944:17)
        at startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17),
    expected: undefined,
    operator: 'doesNotThrow'
  }
## Description Tests do not seem to function. This has been happening since at least https://git.mnpx.dev/mnpx/tree-sitter-wikitext/commit/85eadbbca24f3549dbd77cb86f66ee7774b24b0f. ## Reproduce 1. `npm i` 2. `npm test` ## Logs ```log > tree-sitter-wikitext@0.0.0 test > tsc && node --test bindings/node/*_test.js ✖ can load grammar (2.358562ms) ℹ tests 1 ℹ suites 0 ℹ pass 0 ℹ fail 1 ℹ cancelled 0 ℹ skipped 0 ℹ todo 0 ℹ duration_ms 49.097844 ✖ failing tests: test at bindings/node/binding_test.js:6:1 ✖ can load grammar (2.358562ms) AssertionError [ERR_ASSERTION]: Got unwanted exception. Actual message: "Cannot read properties of undefined (reading 'length')" at TestContext.<anonymous> (<wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:10) at Test.runInAsyncScope (node:async_hooks:214:14) at Test.run (node:internal/test_runner/test:1047:25) at Test.start (node:internal/test_runner/test:944:17) at startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17) { generatedMessage: false, code: 'ERR_ASSERTION', actual: TypeError: Cannot read properties of undefined (reading 'length') at initializeLanguageNodeClasses (<wikitext dir redacted for forgejo issue>/node_modules/tree-sitter/index.js:858:42) at Parser.setLanguage (<wikitext dir redacted for forgejo issue>/node_modules/tree-sitter/index.js:355:5) at <wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:36 at getActual (node:assert:530:5) at Function.doesNotThrow (node:assert:696:32) at TestContext.<anonymous> (<wikitext dir redacted for forgejo issue>/bindings/node/binding_test.js:8:10) at Test.runInAsyncScope (node:async_hooks:214:14) at Test.run (node:internal/test_runner/test:1047:25) at Test.start (node:internal/test_runner/test:944:17) at startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17), expected: undefined, operator: 'doesNotThrow' } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mnpx/tree-sitter-wikitext#3
No description provided.