Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

svi3c/jasmine-ts

Repository files navigation

jasmine-ts

Note: This repository is archived. There will not be any more contributions.

CI

A simplification for running jasmine with ts-node.

Installation

npm i -D jasmine-ts

Usage

  • In your package.json file create a test script:

    {
      "scripts": {
        "test": "jasmine-ts \"path/to/specs/**/*.spec.ts\""
      }
    }
  • Initialize jasmine

    npx jasmine-ts init
    
  • Run the tests

    npm test
    

Running with istanbul coverage

You can use nyc to check your test coverage.

Example package.json:

{
  "scripts": {
    "test": "nyc  -r lcov -e .ts -x \"*.spec.ts\" jasmine-ts \"path/to/specs/**/*.spec.ts\""
  }
}

Note

You still need to install the typings for jasmine to make the typescript-compiler happy about your specs:

TypeScript 2:

npm i -D @types/jasmine

TypeScript 1:

typings i -DG dt~jasmine

Since 0.1.3 ts-node options are passed through to ts-node.