You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run a test in this example, I get this log:
> swc-node@1.0.0 test:swc-node
> node --import @swc-node/register/esm-register --test src/**/*.test.ts
▶ MyClass
✔ should not return an error after the assertion (0.5667ms)
✔ MyClass (1.3728ms)
✖ src\myClass.test.ts (507.915ms)
ℹ tests 2
ℹ suites 1
ℹ pass 1
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 514.5506
✖ failing tests:
test at src\myClass.test.ts:1:1
✖ src\myClass.test.ts (507.915ms)
'test failed'
The tests does nothing more than creating an instance of myClass (without that, it would succeed):
import * as assert from 'assert';
import {describe, it} from 'node:test';
import {MyClass} from "./myClass.js";
describe('MyClass', () => {
it('should not return an error after the assertion', () => {
new MyClass()
assert.ok(true)
})
})
Uh oh!
There was an error while loading. Please reload this page.
I've created a minimal example: https://github.com/JonasDoe/swc-node-issue
When I run a test in this example, I get this log:
The tests does nothing more than creating an instance of
myClass
(without that, it would succeed):MyClass
looks like this:So for some reason my tests is reported as failure besides everything was successful.
The curious thing is: when I remove even a single property or method in
MyClass
, the test succeds, though.I'm using
@swc-node/register@1.10.10
andNode.js@v22.15.0
under Windows 11 withtype: 'module'
.The text was updated successfully, but these errors were encountered: