File tree Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change
1
+ process . env . NODE_ENV = 'test' ;
2
+
3
+ module . exports = {
4
+ require : [ 'ts-node/register' , 'src/testSetup.ts' ] ,
5
+ extension : [ 'ts' ] ,
6
+ spec : [ 'src/**/*.test.ts' ] ,
7
+ exit : true
8
+ }
Original file line number Diff line number Diff line change 71
71
"scripts" : {
72
72
"doc" : " typedoc --out doc --exclude '**/*.test.ts' src" ,
73
73
"prepublishOnly" : " npm run build" ,
74
- "test" : " NODE_ENV=test mocha --exit --require ts-node/register --require src/testSetup.ts src/**/*.test.ts " ,
74
+ "test" : " mocha" ,
75
75
"test-coverage" : " c8 --reporter=json --reporter=html npm test" ,
76
76
"test-staged" : " npm test --bail" ,
77
77
"test-missing-apis" : " npm run build && node scripts/findMissingApi" ,
Original file line number Diff line number Diff line change 1
1
// Global test setup. Runs before each test.
2
2
import { startNvim , stopNvim } from './testUtil' ;
3
3
4
- process . env . NODE_ENV = 'test' ;
5
-
6
4
export const mochaHooks = {
7
5
beforeAll : async ( ) => {
8
6
startNvim ( ) ;
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ export function findNvim(opt: FindNvimOptions = {}): Readonly<FindNvimResult> {
276
276
277
277
// eslint-disable-next-line import/no-mutable-exports
278
278
export let exportsForTesting : any ;
279
- // ' NODE_ENV=test' is being set in testSetup.ts
279
+ // .mocharc.js sets NODE_ENV=test.
280
280
if ( process . env . NODE_ENV === 'test' ) {
281
281
// These functions are intentionally not exported. After `nvim` is found, clients can use Nvim's
282
282
// own `vim.version` module, so node-client shouldn't expose a half-baked "semver" implementation.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import {
14
14
import { Metadata } from '../api/types' ;
15
15
16
16
export let exportsForTesting : any ; // eslint-disable-line import/no-mutable-exports
17
- // ' NODE_ENV=test' is being set in testSetup.ts
17
+ // .mocharc.js sets NODE_ENV=test.
18
18
if ( process . env . NODE_ENV === 'test' ) {
19
19
exportsForTesting = {
20
20
onTransportFail : new EventEmitter ( ) ,
You can’t perform that action at this time.
0 commit comments