Yes, that’d be very nice to have! In a perfect world, all the test suites/ runners we have end up using the same assertion methods. This would indeed greatly improve the portability of individual tests.
Thanks for suggesting this, Till! On 02 Jun 2014, at 12:56, Till Schneidereit <t...@tillschneidereit.net> wrote: > Should we adopt these for SpiderMonkey's test suites, too? Porting tests > between suites isn't something that's done frequently, but there are people > writing tests for more than one suite, and being able to use the same > assertion methods everywhere would be helpful for that. > > > On Mon, Jun 2, 2014 at 12:37 PM, Mike de Boer <mdeb...@mozilla.com> wrote: > Dear unit test writers, > > As a happy few of you might already know, we introduced a standalone, > versatile class of assertion methods with Assert.jsm[1], which implements the > CommonJS Unit Testing specification version 1.1[2]. > > These methods were already available to you in the global `Assert` namespace > in XPCShell-test, Mochitest-browser and Mochitest-chrome tests. > > Since last Friday[3], each assertion method in Assert.jsm is available in the > global scope of a unit test as well. > Now we can say that the ‘old’ XPCShell-test assertion methods are deprecated > in favour of the Assert.jsm ones. > > Here’s a short table of what this means in practice: > > * do_check_eq(a, b) —> equal(a, b) > * do_check_neq(a, b) —> notEqual(a, b) > * do_check_true(expr) —> ok(expr) > * do_check_false(expr) —> ok(!expr) > * do_check_null(expr) —> equal(expr, null) > * do_check_matches(a, b) —> deepEqual(a, b) (undocumented XPCShell-test > feature) > > Please note that we did NOT replace all occurrences with the Assert.jsm > equivalents, we merely marked them as ‘deprecated’ in the docs[4]. > > We’re planning to do the same for Mochitest-browser tests in bug 1018226. > > Now, dear writer and reviewer of unit tests, I’d like to ask if you could > take note of this change and apply it to new tests that’ll land in the tree. > > Finally, I’d like to thank Gregory Szorc, Ted Mielczarek, Blair McBride and > many others who helped getting this change worked out, integrated and so on. > > But we’re not done yet! There are more things we can do to make reading, > writing and tracing tests easier and more fun! > > > Have fun, > > Mike. > > > [1] > https://developer.mozilla.org/en/docs/Mozilla/JavaScript_code_modules/Assert.jsm > [2] http://wiki.commonjs.org/wiki/Unit_Testing/1.1 > [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1014482 > [4] > https://developer.mozilla.org/en-US/docs/Mozilla/QA/Writing_xpcshell-based_unit_tests > [5] https://bugzilla.mozilla.org/show_bug.cgi?id=1018226 > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform