Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make tests run on Windows #17

Closed
wants to merge 1 commit into from

Conversation

laggingreflex
Copy link
Contributor

No description provided.

@@ -7,7 +7,8 @@ require('chai').should()

describe('c8', () => {
it('reports coverage for script that exits normally', () => {
const {output} = spawnSync(c8Path, [
const {output} = spawnSync('node', [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should use process.execPath instead of node.
As is, this would fail if node is not in the PATH. (It may also cause subtle bugs if there are multiple versions of Node)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! fixed.

demurgos added a commit to demurgos/c8 that referenced this pull request Aug 19, 2018
This is a relatively large commit to update the project to use Typescript.

The main benefit is documentation. By annotating the expected type for most values, it can be checked statically and help new maintainers to be confident with their changes. Beyond this, it brings the benefits of type definitions to consumers of the library (completion, type checking, etc).

This first commit does not do any change in the behavior of the code, it does not even type anything. It just adds Typescript and converts the files.

It adds `tslint` as a linter. This commit still results in lint errors but they will be fixed in a subsequent commit.

Even at this minimal stage, it caught a few errors:
- `JSON.parse` received a `Buffer` instead of a `string` in `parse-arg.js` line 8.
- In the integrations tests, it tried to strinfy the `output` field as if was the `stdout` buffer (but it is an array of buffers for the standard streams)
- `bin/c8.js` had to be executable when running the tests. This breaks on Windows

Closes bcoe#17
@bcoe
Copy link
Owner

bcoe commented Sep 8, 2018

@laggingreflex see #22 let's fix some of the outstanding issues once we switch to using Node's built in coverage 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants