expect(() => { expect(1, "blah").to.be.within(null, 1); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
it('should be able to get the channel number', function (done) { // Don't test if not using v2 if (!ourBoard.usingVersionTwoFirmware()) return done(); // The channel number should be between 0 and 25. Those are hard limits. ourBoard.radioChannelGet().then(res => { expect(res.channelNumber).to.be.within(0, 25); done(); }).catch(err => done(err)); });
expect(() => { expect(now, "blah").to.not.be.within(oneSecondAgo, oneSecondAfter); }).to.throw( AssertionError, "blah: expected " + nowUTC + " to not be within " + beforeUTC + ".." + afterUTC );
expect(() => { expect(1).to.be.within(0, null, "blah"); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
expect(() => { expect(1, "blah").to.be.within(0, null); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
expect(() => { expect(1).to.be.within(null, 1, "blah"); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
expect(() => { expect(1).to.not.be.within(null, 1, "blah"); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
expect(() => { expect(1).to.not.be.within(0, null, "blah"); }).to.throw( AssertionError, "blah: the arguments to within must be numbers" );
expect(() => { expect(now).to.not.be.within(now, oneSecondAfter, "blah"); }).to.throw( AssertionError, "blah: expected " + nowUTC + " to not be within " + nowUTC + ".." + afterUTC );
expect(() => { expect(null).to.not.be.within(now, oneSecondAfter, "blah"); }).to.throw(AssertionError, "blah: expected null to be a number or a date");
expect(() => { expect(5, "blah").to.not.be.within(4, 6); }).to.throw(AssertionError, "blah: expected 5 to not be within 4..6");
expect(() => { expect(null, "blah").to.be.within(0, 1); }).to.throw(AssertionError, "blah: expected null to be a number or a date");
expect(() => { expect(now).to.be.within(now, 1, "blah"); }).to.throw(AssertionError, "blah: the arguments to within must be dates");
expect(() => { expect(now).to.be.within(null, now, "blah"); }).to.throw(AssertionError, "blah: the arguments to within must be dates");
expect(() => { expect(now, "blah").to.be.within(now, 1); }).to.throw(AssertionError, "blah: the arguments to within must be dates");