test that invalid constructor forms throw
This commit is contained in:
parent
2a2472a052
commit
f073129f38
@ -23,6 +23,12 @@ export default function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("invalid constructor", function(assert) {
|
||||||
|
assert.throws(
|
||||||
|
function() {new Game("nope", "absolutely", "not"); },
|
||||||
|
new TypeError("unknown form of Game constructor"));
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test("low goal", function(assert) {
|
QUnit.test("low goal", function(assert) {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
function() { new Game(0); },
|
function() { new Game(0); },
|
||||||
|
|||||||
@ -13,6 +13,12 @@ export default function() {
|
|||||||
assert.true(round.canRaise(Team.They), "they initially can raise");
|
assert.true(round.canRaise(Team.They), "they initially can raise");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("invalid constructor", function(assert) {
|
||||||
|
assert.throws(
|
||||||
|
function() {new Round("nope", "absolutely", "not"); },
|
||||||
|
new TypeError("unknown form of Round constructor"));
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test("immediate victory", function(assert) {
|
QUnit.test("immediate victory", function(assert) {
|
||||||
let round = new Round();
|
let round = new Round();
|
||||||
round.winner = Team.We;
|
round.winner = Team.We;
|
||||||
|
|||||||
@ -11,6 +11,12 @@ export default function() {
|
|||||||
assert.strictEqual(rr.winner, Team.We, "correct winner");
|
assert.strictEqual(rr.winner, Team.We, "correct winner");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("invalid constructor", function(assert) {
|
||||||
|
assert.throws(
|
||||||
|
function() {new RoundResult("nope", "absolutely", "not"); },
|
||||||
|
new TypeError("unknown form of RoundResult constructor"));
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test("toStruct", function(assert) {
|
QUnit.test("toStruct", function(assert) {
|
||||||
let rr = new RoundResult(2, Team.They);
|
let rr = new RoundResult(2, Team.They);
|
||||||
let struct = rr.toStruct();
|
let struct = rr.toStruct();
|
||||||
|
|||||||
@ -19,6 +19,12 @@ export default function() {
|
|||||||
assert.strictEqual(session.theirTeam, "", "their team name");
|
assert.strictEqual(session.theirTeam, "", "their team name");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("invalid constructor", function(assert) {
|
||||||
|
assert.throws(
|
||||||
|
function() {new Session("nope", "absolutely", "not"); },
|
||||||
|
new TypeError("unknown form of Session constructor"));
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test("set goal", function(assert) {
|
QUnit.test("set goal", function(assert) {
|
||||||
let session = new Session();
|
let session = new Session();
|
||||||
assert.strictEqual(session.goal, 11, "initial goal");
|
assert.strictEqual(session.goal, 11, "initial goal");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user