1
0

reorganize unit tests

This commit is contained in:
Adrian Wannenmacher 2026-02-11 21:10:50 +01:00
parent 7aeba40043
commit 82082ef84e
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5
6 changed files with 20 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import { Round, Team } from "./round.js";
import RoundResult from "./round_result.js"; import RoundResult from "./round_result.js";
import Game from "./game.js"; import Game from "./game.js";
QUnit.module("models", function() { export default function() {
QUnit.module("game", function() { QUnit.module("game", function() {
QUnit.test("default construction", function(assert) { QUnit.test("default construction", function(assert) {
let game = new Game(); let game = new Game();
@ -343,4 +343,4 @@ QUnit.module("models", function() {
assert.verifySteps(["event"], "event was triggered"); assert.verifySteps(["event"], "event was triggered");
}); });
}); });
}); }

View File

@ -2,7 +2,7 @@
import { Round, Team } from "./round.js"; import { Round, Team } from "./round.js";
QUnit.module("models", function() { export default function() {
QUnit.module("round", function() { QUnit.module("round", function() {
QUnit.test("setup", function(assert) { QUnit.test("setup", function(assert) {
let round = new Round(); let round = new Round();
@ -168,4 +168,4 @@ QUnit.module("models", function() {
assert.verifySteps(["event"], "event was triggered"); assert.verifySteps(["event"], "event was triggered");
}); });
}); });
}); }

View File

@ -3,7 +3,7 @@
import { Team } from "./round.js"; import { Team } from "./round.js";
import RoundResult from "./round_result.js"; import RoundResult from "./round_result.js";
QUnit.module("models", function() { export default function() {
QUnit.module("RoundResult", function() { QUnit.module("RoundResult", function() {
QUnit.test("regular construction", function(assert) { QUnit.test("regular construction", function(assert) {
let rr = new RoundResult(2, Team.We); let rr = new RoundResult(2, Team.We);
@ -49,4 +49,4 @@ QUnit.module("models", function() {
new RoundResult(deso); new RoundResult(deso);
}); });
}); });
}); }

View File

@ -4,7 +4,7 @@ import { Round, Team } from "./round.js";
import Game from "./game.js"; import Game from "./game.js";
import Session from "./session.js"; import Session from "./session.js";
QUnit.module("models", function() { export default function() {
QUnit.module("session", function() { QUnit.module("session", function() {
QUnit.test("initial state", function(assert) { QUnit.test("initial state", function(assert) {
let session = new Session(); let session = new Session();
@ -248,4 +248,4 @@ QUnit.module("models", function() {
assert.throws(function() { new Session(deso); }, "unfinished past"); assert.throws(function() { new Session(deso); }, "unfinished past");
}); });
}); });
}); }

View File

@ -11,10 +11,7 @@
<div id="qunit"></div> <div id="qunit"></div>
<div id="qunit-fixture"></div> <div id="qunit-fixture"></div>
<script src="vendored/qunit-2.25.0.js"></script> <script src="vendored/qunit-2.25.0.js"></script>
<script src="models/round.test.js" type="module"></script> <script src="test.js" type="module"></script>
<script src="models/round_result.test.js" type="module"></script>
<script src="models/game.test.js" type="module"></script>
<script src="models/session.test.js" type="module"></script>
</body> </body>
</html> </html>

11
test.js Normal file
View File

@ -0,0 +1,11 @@
import round from "./models/round.test.js";
import roundResult from "./models/round_result.test.js";
import game from "./models/game.test.js";
import session from "./models/session.test.js";
QUnit.module("models", function() {
round();
roundResult();
game();
session();
});