@tng-sh/js
v0.0.3
Published
TNG JavaScript CLI
Downloads
231
Readme
@tng-sh/js: TNG JavaScript CLI
High-performance test generation and context analysis for JavaScript/TypeScript, powered by Rust (NAPI-RS and OXC).
Installation
npm install @tng-sh/js --save-devQuick Start
1. Initialize
Run the init command to create a tng.config.js configuration file in your project:
npx -p @tng-sh/js tng init2. Generate Tests
Generate a test for a specific function in a file:
npx -p @tng-sh/js tng -f path/to/file.js -m functionName -t react_componentSupported Types (-t):
react_componentexpress_handlergraphql_resolvernest_js(Service/Controller)orm_modelbackground_jobmailerutility
3. Interactive Mode
Launch the interactive UI to explore and generate tests visually:
npx -p @tng-sh/js tng iFeatures
- ⚡️ Fast AST Analysis: Powered by Rust and the
oxcparser for blazing fast static analysis. - 🖥️ Interactive UI: Rich Go-based terminal UI for managing test generation.
- 🎨 Prettier Integration: Automatically formats generated tests to match your project style.
- 📘 TypeScript Support: First-class support for TypeScript analysis.
Configuration
The tng.config.js file allows you to customize the behavior:
module.exports = {
// API Configuration
API_KEY: "your-api-key-here",
API_URL: "https://app.tng.sh/",
// Framework Detection
// Options: express, nextjs, nestjs, generic
FRAMEWORK: "express",
// Testing Configuration
// Options: jest, mocha, vitest
TEST_FRAMEWORK: "jest",
// Test Directory
TEST_DIRECTORY: "tests"
};