Closed Bug 866535 Opened 11 years ago Closed 8 years ago

Changes in test finder breaks `__$coverObject` globals


(Add-on SDK Graveyard :: General, defect, P3)



(Not tracked)



(Reporter: glind, Unassigned)


In or around 879a04f0 ( ), something changed with test discovery that makes it that the `global` var at  no longer runs.

FWICT, in this layout:

sdk/test/harness     <- uses CustomLoader, YES `global`
--> test-main.js              <- found by deprecated/unit-test-finder, no `global`
      - require("./main.js")  <- no global

- the harness CustomLoader needs to be used at as well.

If you want to see how this impacts an addon... see 

(Also, of people want to revisit how to do code coverage, I am open to suggestions!)
I know this sounds like a P3 on the surface, but is a smoke test for the (perhaps) P1 problem of "working on addons is almost, but not quite, like doing other javascript".

Working with addon code in a regimented way is really hard for these reasons:

1.  JS1.7 means the whole tooling stack needs to be forked.  (Or one limits oneself to JS1.5 code).  I have been tempted to move to CoffeeScript or 1.5 just so can actually have linting and validation

2.  Part of why people believe in Micropilot is that I had 99% code coverage.  That was part of why I believed in it as well!   

3.  I am trying to fix this bug, and not making much headway.  The testing code (sdk/test) and discovery (sdk/deprecated/unit*) code is very tangled.  


In the test code, all loaders everywhere share a 'global' object.  Right now, all the "test-" code shares it, but that is not where the coverage needs to happen :)
Is this still an issue?
Flags: needinfo?(glind)
We still sort of have test coverage working.  It's super flaky and fragile and uses  `freaktechnik/istanbul-jpm`
Closed: 8 years ago
Flags: needinfo?(glind)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.