Registry / testing / j2ts-junit

j2ts-junit

JSON →
library92.0.0jsnpmunverified

Required runtime dependency for the J2TS transpiler that converts Java code to TypeScript. Version 92.0.0 is current. The package provides JUnit-like annotations and test infrastructure for transpiled TypeScript tests. Closely tied to the J2TS ecosystem; not useful standalone. Updated infrequently alongside the transpiler. No alternatives exist for J2TS projects.

npm install j2ts-junit
INSTALL
IMPORT
SIG · J2TS-JUNIT
J
j2ts-junit
testingjavascriptv92.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Test
import { Test } from 'j2ts-junit'
ESM import; works with TypeScript and bundlers.
Test
const { Test } = require('j2ts-junit')
const Test = require('j2ts-junit').Test
CJS destructure works; avoid property assignment.
J2tsJunit
import J2tsJunit from 'j2ts-junit'
import { J2tsJunit } from 'j2ts-junit'
Default export is the namespace object; named export does not exist.

Example of JUnit-style test using decorators and assertions in TypeScript.

import { Test, Before, After, Assert } from 'j2ts-junit'; class MyTest { @Before setup(): void { console.log('setup'); } @Test testAddition(): void { Assert.assertEquals(4, 2 + 2); } @After teardown(): void { console.log('teardown'); } }
Debug
Known issues
gotchaPackage is tied to J2TS transpiler version; mismatched versions may cause runtime errors.
fix
Keep j2ts-junit version aligned with the J2TS transpiler version used in your project.
affects: *
deprecatedThe Assert class methods may be deprecated in favor of chai or other assertion libraries in future versions.
fix
Check changelog for assertion migration guidance.
affects: >=90.0.0
Errors
Common errors & fixes
Cannot find module 'j2ts-junit'
Package not installed or not in node_modules.
fix
Run 'npm install j2ts-junit' and ensure it is in package.json dependencies.
TypeError: Class extends value undefined is not a constructor or null
Missing runtime dependency from J2TS transpiler.
fix
Ensure 'j2ts-core' is also installed and at compatible version.
Upgrade
Version history
92.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
j2ts-junit — npm install j2ts-junit · libregistry