-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
wip! use tap.spawn() for each test #85
Conversation
The intent was to use an older version of micromatch, but the current semver specification allows up to latest. The carrot range will allow any version up to, but not including 3.0.0. Switched to a tilde range which allows up to, but not including 2.2.0.
Annoyingly they now don't work *with* tap --coverage, but on the other hand the fixes seem legit: Spawning tests need to run via bin/nyc otherwise they end up relying on tap's coverage reporting. The 'runs reports for all JSON in output directory' test should spawn a subprocess that itself spawns more processes, else only a single file would be generated. The 'handles corrupt JSON files' test doesn't need to spawn a subprocess, it just has to inject the corrupt JSON file into the output directory.
079633a
to
0e20f6c
Compare
@jamestalmage @bcoe this works a bit better now. Tests pass without I had to fix some tests, these fixes seem to be generally applicable if I'm understanding everything correctly. If you run with Note that I needed #88 for my tests to pass. I was getting an error in |
I really think jamestalmage@ad9a7ba is the best strategy for providing our own coverage. Between require hooks and spawn-wrap I think we will continue to run the risk of false positive tests like #86. I could pull that out of PR #89 if we decide this is the forking strategy to go with. As for this forking strategy vs what I am doing in #89, there are some tradeoffs: Things this does better:
Things that are better about #89
describe('foo', function () {
rimraf.sync('foo') // this will actually behave like a beforeEach for this describe block
it('foo-test-1', function() {
// ...
})
it('foo-test-2', function () {
// ...
})
assert(fs.readDirSync('foo').length === x) // an afterEach assertion - applicable only to the `foo` describe block
})
describe('bar', function() {
// The "beforeEach" / "afterEach" from the `foo` block will not be run in this fork
// My understanding of this PR is that they would be
}) Where they both suck:
|
Another suggestion for #80. My "crazier idea" as mentioned in #83:
master
has 21 tests, this has 17, so some are not being executed