{"id":25773,"library":"j2ts-junit","title":"Java2TypeScript JUnit","description":"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.","status":"active","version":"92.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/datathings/java2typescript","tags":["javascript","typescript"],"install":[{"cmd":"npm install j2ts-junit","lang":"bash","label":"npm"},{"cmd":"yarn add j2ts-junit","lang":"bash","label":"yarn"},{"cmd":"pnpm add j2ts-junit","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import; works with TypeScript and bundlers.","symbol":"Test","correct":"import { Test } from 'j2ts-junit'"},{"note":"CJS destructure works; avoid property assignment.","wrong":"const Test = require('j2ts-junit').Test","symbol":"Test","correct":"const { Test } = require('j2ts-junit')"},{"note":"Default export is the namespace object; named export does not exist.","wrong":"import { J2tsJunit } from 'j2ts-junit'","symbol":"J2tsJunit","correct":"import J2tsJunit from 'j2ts-junit'"}],"quickstart":{"code":"import { Test, Before, After, Assert } from 'j2ts-junit';\n\nclass MyTest {\n  @Before\n  setup(): void {\n    console.log('setup');\n  }\n\n  @Test\n  testAddition(): void {\n    Assert.assertEquals(4, 2 + 2);\n  }\n\n  @After\n  teardown(): void {\n    console.log('teardown');\n  }\n}","lang":"typescript","description":"Example of JUnit-style test using decorators and assertions in TypeScript."},"warnings":[{"fix":"Keep j2ts-junit version aligned with the J2TS transpiler version used in your project.","message":"Package is tied to J2TS transpiler version; mismatched versions may cause runtime errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Check changelog for assertion migration guidance.","message":"The Assert class methods may be deprecated in favor of chai or other assertion libraries in future versions.","severity":"deprecated","affected_versions":">=90.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install j2ts-junit' and ensure it is in package.json dependencies.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'j2ts-junit'"},{"fix":"Ensure 'j2ts-core' is also installed and at compatible version.","cause":"Missing runtime dependency from J2TS transpiler.","error":"TypeError: Class extends value undefined is not a constructor or null"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}