Commit Graph

17 Commits

Author SHA1 Message Date
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Guangcong Luo
44ef998ecc Implement free-for-all
This involves a huge refactor for how battles are constructed, but
it's totally worth it.

Currently, tournaments, challenges, and laddering are unsupported; only
unrated searches work. But it does work, and it's beautiful.
2021-04-01 04:44:16 -07:00
Guangcong Luo
da30a71706 Revert "Remove User#inRooms and User#games (#7815)"
This reverts commit 5c9c84c415.

This also reverts commit 1fc92ef977.
2021-01-30 15:55:55 -05:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Guangcong Luo
a68656a8e7 Support destroying rooms in unit tests
Matchmaking unit tests currently rely on destroying and re-creating a
user causing them to forget about battles they're in, which is not
actually supposed to happen, and breaks #7815.
2021-01-10 03:39:01 -08:00
Guangcong Luo
66fe68e8ee Tests: Refactor users-utils
The old users-utils had an unnecessarily difficult-to-use API. This
new one should be more straightforward and unified.
2021-01-09 22:33:32 -08:00
Guangcong Luo
a65faf263f
Stop using assert.strict.strictEqual (#7515)
It turns out that when I switched us from `assert` to `assert.strict`,
I didn't actually update any existing tests or tell anyone:

0df0d234f2

So apparently everyone else just kept on using `strictEqual`.

This will be a PR and also throw an error if people continue trying to
use it, which should make it much clearer what PS policy is on this.

A lot of the problem may be that TypeScript marks assert.strict.equal
as deprecated when it's not. This was fixed 4 days ago:

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48452

But this probably hasn't made it to a thing yet. Until then, you'll
have to deal with TS marking your tests as deprecated, but it shouldn't
be too long.

Accidentally using `assert` instead of `assert.strict` should now show
an error. This protects against the probably much worse mistake of
accidentally using `assert.equal` rather than `assert.strict.equal`.

`assert.ok` is also deprecated now.
2020-10-14 01:19:03 -07:00
Kirk Scheibelhut
eea2196280
Server side changes to support persistent user settings and privacy changes (#6947)
NOTE: This is changes the semantics of `hidenext`/`ionext` from
applying to the next created *battle* to applying to the next
created *search*/*challenge*.
2020-07-06 21:18:38 -07:00
Guangcong Luo
f6f4467265 Turn on prefer-const for .js files
Not having prefer-const on the JS side makes JS -> TS refactors really
unreadable. This commit just auto-fixes it so we're using
`prefer-const` everywhere.
2020-04-23 11:37:47 -07:00
Guangcong Luo
229f5f809d Use assert in strict mode
This makes it so we can use `assert.equal` instead of
`assert.strictEqual`, which I think is more readable.
2020-02-20 00:39:31 -08:00
Waleed Hassan
da4b887054 Rename Room#id -> Room#roomid, User#userid -> User#id (#5826)
These should make it clearer that userids are IDs but roomids aren't.
2019-10-03 18:57:38 +10:00
TheJetOU
2b28c9fd6b Refactor Rooms(), Users() to Rooms.get(), Users.get() (#5725) 2019-08-25 06:33:56 -07:00
TheJetOU
4f7ad0132b TypeScript Ladders (#5696) 2019-08-12 09:48:18 +02:00
Kirk Scheibelhut
8c7abf8729 Move dev-tools/user-utils.js -> test/user-utils.js 2019-04-15 15:24:56 -07:00
Slayer95
ffb3678b0f Test: Update folder structure to match source code (#5436) 2019-04-14 23:57:06 +09:30