npm.io
0.0.15 • Published 2 years agoCLI

@xieyuheng/test-case

Licence
GPL-3.0-or-later
Version
0.0.15
Deps
6
Size
60 kB
Vulns
0
Weekly
0

Test Case

Minimalist Test Framework for JavaScript/TypeScript.

Installation

npm install @xieyuheng/test-case

Usage

Command line tool

The command line program is called test-case.

test-case run lib/examples/number.case.js

Example

import { TestCase } from "@xieyuheng/test-case"

export default class extends TestCase {
  // NOTE Method name startsWith "test" will be viewed as a test
  test_add() {
    this.assertEquals(1 + 1, 2)
    this.assertNotEquals(1 + 1, 3)
  }

  "method name includes whitespace will be viewed as a test"() {
    this.assert(true)
  }
}

Please see src/examples for more examples, including:

Subclassing

Development

npm install    // Install dependencies
npm run build  // Compile `src/` to `lib/`
npm run watch  // Watch the compilation
npm run test   // Run test

Contributions

Be polite, do not bring negative emotion to others.

License