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 7171 "scripts" : {
7272 "doc" : " typedoc --out doc --exclude '**/*.test.ts' src" ,
7373 "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" ,
7575 "test-coverage" : " c8 --reporter=json --reporter=html npm test" ,
7676 "test-staged" : " npm test --bail" ,
7777 "test-missing-apis" : " npm run build && node scripts/findMissingApi" ,
Original file line number Diff line number Diff line change 11// Global test setup. Runs before each test.
22import { startNvim , stopNvim } from './testUtil' ;
33
4- process . env . NODE_ENV = 'test' ;
5-
64export const mochaHooks = {
75 beforeAll : async ( ) => {
86 startNvim ( ) ;
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ export function findNvim(opt: FindNvimOptions = {}): Readonly<FindNvimResult> {
276276
277277// eslint-disable-next-line import/no-mutable-exports
278278export let exportsForTesting : any ;
279- // ' NODE_ENV=test' is being set in testSetup.ts
279+ // .mocharc.js sets NODE_ENV=test.
280280if ( process . env . NODE_ENV === 'test' ) {
281281 // These functions are intentionally not exported. After `nvim` is found, clients can use Nvim's
282282 // 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 {
1414import { Metadata } from '../api/types' ;
1515
1616export 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.
1818if ( process . env . NODE_ENV === 'test' ) {
1919 exportsForTesting = {
2020 onTransportFail : new EventEmitter ( ) ,
You can’t perform that action at this time.
0 commit comments