Skip to content

Commit 7835330

Browse files
authored
docs: update README
1 parent 8cda08b commit 7835330

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ espower-typescript
99
[![Dependency Status][deps-image]][deps-url]
1010
![License][license]
1111

12-
## Install
13-
14-
```console
15-
$ npm install -D espower-typescript
16-
```
17-
1812
## TypeScript versions
1913

2014
* espower-typescript v8.x uses TypeScript v2.2, v2.3 and v2.4
@@ -27,13 +21,30 @@ $ npm install -D espower-typescript
2721

2822
## Usage
2923

24+
### Install
25+
26+
```console
27+
$ npm install -D espower-typescript power-assert mocha
28+
```
29+
3030
### Zero-config mode
3131

32+
```typescript
33+
// test/test.ts
34+
import assert = require('assert');
35+
36+
describe('Array#join', () => {
37+
it('joins all elements into a string with separator', () => {
38+
assert(['a', 'b', 'c'].join(':') === 'a:b:c');
39+
});
40+
});
41+
```
42+
3243
```console
33-
$ mocha --compilers ts:espower-typescript/guess test/**/*.ts
44+
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess test/**/*.ts
3445
```
3546

36-
### If your tests are not in test dir
47+
### If your tests are not in `test` directory
3748

3849
You can set test directory in your `package.json`
3950

@@ -52,7 +63,7 @@ You can set test directory in your `package.json`
5263
Then, run mocha with `--compilers ts:espower-typescript/guess`
5364

5465
```console
55-
$ mocha --compilers ts:espower-typescript/guess spec/**/*.ts
66+
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess spec/**/*.ts
5667
```
5768

5869
Note: `'espower-typescript/guess'` is inspired by [intelli-espower-loader](https://github.com/azu/intelli-espower-loader)

0 commit comments

Comments
 (0)