1
0
Commit Graph

7 Commits

Author SHA1 Message Date
3bf6cc52ab
switch round over to a general change event 2026-02-16 22:51:49 +01:00
bcb08a64d2
fix bug in tailor calculation
The tailor calculation did not go down to one point if the losing team
scored points only after the winning team reached the tailor goal. This
has been fixed.

This made me realize that I forgot to write tests for the `results`
property of the game and session models. Those will follow in a later
commit.
2026-02-15 22:29:03 +01:00
fb2fd76c6c
add a bit of documentation 2026-02-15 15:43:15 +01:00
2af6cb4f6a
test exception types and messages
As I noted in commit 85b9c2459c I noticed
that the testing of the invalidity of invalid struct "deserialization"
was not sound. That was because if one error was not actually thrown,
the test would still be satisfied by the following error. However, if
only that specific thing was wrong, no error would be thrown and an
invalid struct would be accepted.

Therefore I now changed those tests to also check the exception type and
its message. This means that if an exception is missing, it is
immediately picked up.

I also found out that one exception was actually wrong. I had mistyped
`TypeError` as `TypError`. Funnily enough that still causes an exception
to be thrown at that location, but a `ReferenceError` instead of the
`TypeError`. Such bugs should now be more easily noticable.
2026-02-15 04:27:08 +01:00
85b9c2459c
switch from JSON to structural cloning
There are two reasons for this:

1. I've reconsidered my original plan to store the past games in
   localStorage, because that would make it difficult to display them in
   historical order, and would necessitate more complex logic for
   updating and removing sessions.

2. I've been unhappy with how I did the testing of the serialization and
   deserialization logic. So I redid it, and now I'm satisfied with it.

I've noticed that the testing methodology for the invalid fromStruct
method tests is not fully sound. If a check is accidentally removed that
test would not detect that, as long as it is not the very last. That is
because then the next error triggers. Therefore that will need to be
revisited.
2026-02-12 01:01:03 +01:00
6971a2b20c
make round finishing trigger an event 2026-02-09 20:24:17 +01:00
1cb03ef70c
implement model for full games 2026-02-09 03:36:18 +01:00