0.0.15 • Published 7 months ago

@xieyuheng/test-case v0.0.15

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
7 months ago

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