Closed Bug 1412282 Opened 8 years ago Closed 8 years ago

Allow calling Assert.jsm methods directly from other test-only modules

Categories

(Testing :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(1 file)

We use test-only modules to share utilities that are specific to an area of the code and make them available to all the tests in the tree. In order to use assertions from these modules, we have to pass the current Assert.jsm scope to them explicitly. However, we don't use multiple instances in practice because the scope is always the one for the currently running test, and the test-only modules share this globally anyways. We also never run tests in parallel in the same process because this would run into a number of other issues, tests are parallelized using multiple processes. We can do a minimal change to make the Assert.jsm scope a per-process global, available just by importing the module. To minimize changes, we can make the constructor also return the global instance.
Comment on attachment 8922803 [details] Bug 1412282 - Allow calling Assert.jsm methods directly from other test-only modules. https://reviewboard.mozilla.org/r/193954/#review199558 Cool, thanks!
Attachment #8922803 - Flags: review?(mdeboer) → review+
Pushed by paolo.mozmail@amadzone.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/90b950f6e65b Allow calling Assert.jsm methods directly from other test-only modules. r=mikedeboer
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: