power-assert-js/espower-typescript

Name: espower-typescript

Owner: power-assert-js

Description: power-assert instrumentor for TypeScript

Created: 2015-05-11 17:49:54.0

Updated: 2018-05-04 03:09:22.0

Pushed: 2018-03-28 12:31:25.0

Homepage:

Size: 103

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

espower-typescript

power-assert instrumentor for TypeScript

npm version Node.js Version Support build status Dependency Status License

TypeScript versions
Usage
Install
m install -D espower-typescript power-assert mocha
Zero-config mode
est/test.ts
rt assert = require('assert');

ribe('Array#join', () => {
('joins all elements into a string with separator', () => {
assert(['a', 'b', 'c'].join(':') === 'a:b:c');
;

onsole
or mocha version >= 4
node_modules/.bin/mocha --require espower-typescript/guess "test/**/*.ts"


or mocha version < 4 (deprecated)
node_modules/.bin/mocha --compilers ts:espower-typescript/guess "test/**/*.ts"
If your tests are not in test directory

You can set test directory in your package.json


"name": "your-module",
"description": "Your module",
"version": "0.0.1",
"directories": {
    "test": "spec/"
},


Then, run mocha with --require espower-typescript/guess

or mocha version >= 4
node_modules/.bin/mocha --require espower-typescript/guess "spec/**/*.ts"

or mocha version < 4 (deprecated)
node_modules/.bin/mocha --compilers ts:espower-typescript/guess "spec/**/*.ts"

Note: 'espower-typescript/guess' is inspired by intelli-espower-loader

tsconfig.json and CompilerOptions

If tsconfig.json is in your prject root, 'espower-typescript/guess' loads it automatically.

Note: only compilerOptions field in tsconfig.json is applied.

JSX/React

.tsx files are supported.

License

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.