https://github.com/qdouble/jasmine-ts
Attempt to upgrade to jasmine 3+
https://github.com/qdouble/jasmine-ts
Last synced: 11 days ago
JSON representation
Attempt to upgrade to jasmine 3+
- Host: GitHub
- URL: https://github.com/qdouble/jasmine-ts
- Owner: qdouble
- License: mit
- Created: 2018-07-30T06:48:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-10T07:08:34.000Z (almost 8 years ago)
- Last Synced: 2025-02-25T09:46:41.492Z (over 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jasmine-ts
[](https://travis-ci.org/svi3c/jasmine-ts)
A simplification for running [jasmine](https://www.npmjs.com/package/jasmine) with
[ts-node](https://github.com/TypeStrong/ts-node).
## Installation
```
npm i -D jasmine-ts
```
## Usage
* In your `package.json` file create a test script:
```json
{
"scripts": {
"test": "jasmine-ts \"path/to/specs/**/*.spec.ts\""
}
}
```
* Initialize jasmine
```
node_modules/.bin/jasmine-ts init
```
Note: This module enables the configuration support of
reporters. For example, if you want to use the
[jasmine-spec-reporter](https://github.com/bcaudan/jasmine-spec-reporter),
which provides a nice output, you can add a reporters array to the `jasmine.json`
file like this:
```json
{
"reporters": [
{
"name": "jasmine-spec-reporter#SpecReporter",
"options": {
"displayStacktrace": "all"
}
}
]
}
```
If the reporters are not the default export of the module,
you can reference another export by using the `#` separator.
* Run the tests
```
npm test
```
### Running with istanbul coverage
You can use [nyc](https://github.com/istanbuljs/nyc) to check your test coverage.
Example `package.json`:
```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](https://www.npmjs.com/package/ts-node#configuration-options) are passed through to ts-node.