Bug 1326534 - Add test for assert.array; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 30 Dec 2016 11:30:05 +0000
changeset 457105 64ac13861b524c0d85a9a384f663df899a8d9548
parent 457104 a2cb1121cf3dbc430d1bc9c83856cc5ac090958a
child 457106 36ea2874be623e6b69a717d636cda327d1f55dd6
push id40670
push userbmo:ato@mozilla.com
push dateFri, 06 Jan 2017 18:52:13 +0000
reviewersautomatedtester
bugs1326534
milestone53.0a1
Bug 1326534 - Add test for assert.array; r?automatedtester MozReview-Commit-ID: IWUnhCgPp1R
testing/marionette/test_assert.js
--- a/testing/marionette/test_assert.js
+++ b/testing/marionette/test_assert.js
@@ -71,16 +71,25 @@ add_test(function test_object() {
   assert.object(new Object());
   for (let typ of [42, "foo", true, null, undefined]) {
     Assert.throws(() => assert.object(typ), InvalidArgumentError);
   }
 
   run_next_test();
 });
 
+add_test(function test_array() {
+  assert.array([]);
+  assert.array(new Array());
+  Assert.throws(() => assert.array(42), InvalidArgumentError);
+  Assert.throws(() => assert.array({}), InvalidArgumentError);
+
+  run_next_test();
+});
+
 add_test(function test_that() {
   equal(1, assert.that(n => n + 1)(1));
   Assert.throws(() => assert.that(() => false)());
   Assert.throws(() => assert.that(val => val)(false));
   Assert.throws(() => assert.that(val => val, "foo", SessionNotCreatedError)(false),
       SessionNotCreatedError);
 
   run_next_test();