Skip to content

Commit e7a2216

Browse files
castaneaiteppeis
authored andcommitted
Ref #42 Update README to avoid DeprecationWarning in mocha v4+ (#43)
1 parent 1934a39 commit e7a2216

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ describe('Array#join', () => {
4141
```
4242

4343
```console
44-
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess test/**/*.ts
44+
// for mocha version >= 4
45+
$ ./node_modules/.bin/mocha --require espower-typescript/guess "test/**/*.ts"
46+
47+
48+
// for mocha version < 4 (deprecated)
49+
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess "test/**/*.ts"
4550
```
4651

4752
### If your tests are not in `test` directory
@@ -60,10 +65,14 @@ You can set test directory in your `package.json`
6065
}
6166
```
6267

63-
Then, run mocha with `--compilers ts:espower-typescript/guess`
68+
Then, run mocha with `--require espower-typescript/guess`
6469

6570
```console
66-
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess spec/**/*.ts
71+
// for mocha version >= 4
72+
$ ./node_modules/.bin/mocha --require espower-typescript/guess "spec/**/*.ts"
73+
74+
// for mocha version < 4 (deprecated)
75+
$ ./node_modules/.bin/mocha --compilers ts:espower-typescript/guess "spec/**/*.ts"
6776
```
6877

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

0 commit comments

Comments
 (0)