npm inpm tnpm i mocha@^11npm t
First run, using mocha 10, works.
Second run will fail because somehow the modules are not loaded correctly.
The "only" difference is mocha. Why is tsx no longer working corectly
| node_modules/ |
| import * as assert from "node:assert"; | |
| import env from "@zazuko/env"; | |
| import { describe, it } from "mocha"; | |
| describe('using tsx', () => { | |
| it('should load module correctly', () => { | |
| assert.equal(env.ns.schema.Person.value, "http://schema.org/Person") | |
| }) | |
| }); |
| { | |
| "name": "mocha-tsx", | |
| "type": "module", | |
| "scripts": { | |
| "test": "mocha index.test.ts" | |
| }, | |
| "dependencies": { | |
| "@zazuko/env": "^3.0.1", | |
| "mocha": "^10", | |
| "tsx": "^4.21.0", | |
| "typescript": "^5.9.3" | |
| }, | |
| "mocha": { | |
| "require": "tsx" | |
| } | |
| } |