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

add covenience util for debugging #225

Closed
wants to merge 4 commits into from

Conversation

jamestalmage
Copy link
Contributor

Launches a single test in the same process

Logs what would be sent to the parent process (in magenta!).

Makes sure the ava-cleanup method gets called on exit (so you can verify unhandled rejections).

@sindresorhus
Copy link
Member

You need to add it to files in package.json.

@jamestalmage
Copy link
Contributor Author

Oh sorry, I wasn't clear - I intended it just for internal development use. Not public consumption. I guess it would not be a terrible idea to publish it. We could ask users to execute tests with it and send the output. Might help hunt down some difficult bug someday.

What do you think?

@sindresorhus
Copy link
Member

@jamestalmage Oh ok. Then let's keep it internal like this for now until a need arises.

@sindresorhus
Copy link
Member

@jamestalmage Can you add a short example on how to use this to https://github.com/sindresorhus/ava/blob/master/maintaining.md ?

@vdemedes Thoughts?

@vadimdemedes
Copy link
Contributor

I did not have a need for something like that for now, but if you find it useful, why not. But still, I don't think it should be included on npm. Perhaps leave it as an open PR?

@sindresorhus
Copy link
Member

@vdemedes It's currently not included in the npm package as it's not listed in the files field in package.json. I would rather have it in the repo than an open PR.

@vadimdemedes
Copy link
Contributor

Oh wait, I have an idea. Why don't we use debug in AVA? It will allow for an extremely easy debugging and a simple way to enable it. Plus, we won't need to ship/include one more file.

$ DEBUG=ava ava test.js
$ DEBUG=ava:fork ava test.js
$ DEBUG=ava:* ava test.js

And it's been more or less a standard way to enable logs for a certain module (check debug readme).

@sindresorhus
Copy link
Member

👍

@jamestalmage
Copy link
Contributor Author

That still requires forking a process. It doesn't capture everything sent via process.send.

@vadimdemedes
Copy link
Contributor

fork.on('message', function (message) {
  // log message
});

?

@vadimdemedes
Copy link
Contributor

It will capture everything that a forked process sends via process.send(), won't it?

@jamestalmage
Copy link
Contributor Author

Did somebody force push to master?

@vadimdemedes
Copy link
Contributor

Nope, but somehow maintaining.md ended up in your PR. Rebase gone wrong?

@vadimdemedes
Copy link
Contributor

Anyway, I think this PR should be closed in favor of using debug utility, so don't bother fixing it.

@sindresorhus
Copy link
Member

Closing in favor of #242.

@jamestalmage jamestalmage deleted the debug-script branch November 28, 2015 06:26
@hberntsen hberntsen mentioned this pull request Dec 16, 2015
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