I am running vitest runner. Then I see that someone probably vitest is generating from my .ts files some .js files:
The error message I get seems to be originating from the uiElementsCreator.test.js:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var vitest_1 = require("vitest");
/*import { CompositeChangeResponse, ChangeResponseTreeItem, ConfigurationResult } from "../src/App/apis/models/compositeChangeResponse";
import { GlobalStore } from '../src/App/components/ConfigurationStepper/_shared/helper/globalStore';*/
(0, vitest_1.describe)("Test UiElementsCreator", function () {
(0, vitest_1.describe)("test request composite on value change", function () {
(0, vitest_1.test)("Given element is mandatory and active with specific id, expect them
... rest of test removed for clarity
Error:
FAIL test/lib/test/uiElementsCreator.test.js [ test/lib/test/uiElementsCreator.test.js ]
Error: Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.
If you are using "import" in your source code, then it's possible it was bundled into require() automatically by your bundler. In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic impo
rt() which is available in all CommonJS modules.
vitest seems to be using require() although it does complain about it!
var vitest_1 = require("vitest");
What do I wrong here?