Skip to content

Tests fail with Node.JS 23.7.x #1018

@rubin55

Description

@rubin55

Describe the bug

yarn --frozen-lockfile
yarn compile
yarn test

Output:

yarn run v1.22.22
$ mocha --require ts-node/register --timeout 5000 --ui bdd ./test/*.test.ts
(node:37537) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:37537) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/rubin/Desktop/yaml-language-server/test/arrUtils.test.ts is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /home/rubin/Desktop/yaml-language-server/package.json.

SyntaxError[ @/home/rubin/Desktop/yaml-language-server/test/autoCompletion.test.ts ]:   x TypeScript import equals declaration is not supported in strip-only mode
    ,-[15:1]
 12 |   TestCustomSchemaProvider,
 13 |   toFsPath,
 14 | } from './utils/testHelper';
 15 | import assert = require('assert');
    : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 16 | import path = require('path');
 17 | import { createExpectedCompletion } from './utils/verifyError';
 18 | import { ServiceSetup } from './utils/serviceSetup';
    `----
  x TypeScript import equals declaration is not supported in strip-only mode
    ,-[16:1]
 13 |   toFsPath,
 14 | } from './utils/testHelper';
 15 | import assert = require('assert');
 16 | import path = require('path');
    : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 17 | import { createExpectedCompletion } from './utils/verifyError';
 18 | import { ServiceSetup } from './utils/serviceSetup';
 19 | import { CompletionList, InsertTextFormat, MarkupContent, MarkupKind, Position } from 'vscode-languageserver-types';
    `----

    at parseTypeScript (node:internal/modules/typescript:67:15)
    at processTypeScriptCode (node:internal/modules/typescript:129:42)
    at stripTypeScriptModuleTypes (node:internal/modules/typescript:196:22)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:146:26)
    at defaultGetFormat (node:internal/modules/esm/get_format:209:36)
    at defaultLoad (node:internal/modules/esm/load:119:22)
    at async ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:519:32)
    at async ModuleJob._link (node:internal/modules/esm/module_job:115:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected Behavior

README.md indicates node v12 or higher, so tests should succeed using latest node.

Current Behavior

See previous output.

Steps to Reproduce

See bug description.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Labels

Type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions