ben-page / node-test

A simple, asynchronous test runner for Node.js.
https://www.npmjs.com/package/node-test
MIT License
4 stars 1 forks source link

Property 'exitCode' does not exist on type 'Process' #3

Closed ghost closed 8 years ago

ghost commented 8 years ago

In never versions of NodeJS there is no exitCode on Process.

Your code here will cause a bug:

if (failures.length > expected.length)
            process.exitCode = 1;
ben-page commented 8 years ago

Can you provide a source for this information? process.exitCode exists in v6.3.1 (latest version) and is not listed as deprecated in the documentation.

ghost commented 8 years ago

For normal usage this is working and not deprecated, but soon as you try to integrate Angular 2 or TypeScript this fails. In TypeScript ( Angular 2 is done with TS) you have to include various types. Default for node.js is node.d.ts file. This file follows latest specs. The file is here and updated 6 days ago. All process related stuff is inlcuded except exitCode.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/node/node.d.ts

I opened an issue regarding this so we can see what they have to say about it: https://github.com/Microsoft/TypeScript/issues/9940

ben-page commented 8 years ago

Seems like a bug in TypeScript. I'm definitely going to keep this in. Setting the exit code is pretty important for CI to know if the tests passed or not.