Commit Graph

122 Commits

Author SHA1 Message Date
Slayer95
b0dc94f196
Further update tests after startup refactor (#11521)
- Adds config.lazysockets to prevent listening to the network
- Fixes modlog tests
2026-01-25 07:58:21 -05:00
Guangcong Luo
9fd696977c Fix crash in formatText 2026-01-10 14:36:51 -08:00
Alex "Mathy
bc044e3037
IPTools: Fix CIDR ranges at 128.* and up (#11466)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-10-25 18:26:44 -04:00
Slayer95
4b8c6a4d6d
Refactor startup (#11346)
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
This minimizes side effects of import/require across the codebase,
and lets the caller be responsible of initializing child processeses,
as well as other async logic, such as restoring saved battles.
2025-10-17 19:37:47 -07:00
Alex "Mathy
ee81fdcca9
IPTools: Fix CIDR implementation (#11448)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-09-15 17:38:55 -05:00
Kris Johnson
8797d4628c Remove inactive ladders 2025-08-31 23:57:15 -06:00
Guangcong Luo
091241f1bb
Sim: Emit requests after updates (#11105)
Fixes #8546
2025-05-15 20:30:02 -07:00
WifiLatency
9c1457ee9b
/ds: Collapsibles New Styling (#11041)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-04-21 05:07:44 -07:00
Sergio Garcia
fc23103de1
Fix random typos (#11020)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-04-13 23:59:36 -07:00
WifiLatency
c4a5ed50e4
/ds: Param to expand collapsible datasearches by default (#11023)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Reimplement all as a param to automatically expand nonbroadcast results.

* Tests ensuring datasearches don't expand when broadcast with all
2025-04-08 23:53:40 -06:00
WifiLatency
bdeb19f26a
/ds: Add rule functionality (#10973)
* /ds metagame rules with moves compability.

* mon attributes compatibility

* pokedex rule compatibility.

* clean up. support convergencelegality

* updated dexsearchhelp. better error feedback.

* Fix negations for abilities and moves.

* Scrapped convergence, cleanup.

* Updated dshelp for the mapped rule param values.

* Fixed duplicate formes and tests reciving species.

* Support /ds stacking multiple rules

* Apply suggestions from code review

* tests for /ds rule functionality

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-03-18 00:50:32 -06:00
Guangcong Luo
78439b4a02
Update to ESLint 9 (#10926)
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.

- First, we no longer have separate eslint-no-types configs. Lint
  performance shouldn't be enough of a problem to justify the
  relevant maintenance complexity.

- Second, our base config should work out-of-the-box now. `npx eslint`
  will work as expected, without any CLI flags. You should still use
  `npm run lint` which adds the `--cached` flag for performance.

- Third, whatever updates I did fixed style linting, which apparently
  has been bugged for quite some time, considering all the obvious
  mixed-tabs-and-spaces issues I found in the upgrade.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed. We now
  consistently use template strings for this.
2025-02-25 20:03:46 -08:00
Mia
e82c5fa161 Change references of & to ~ 2024-10-01 09:02:03 -05:00
Guangcong Luo
cec317671e Cleanup RoomGame implementations again
This reinstates the recently-reverted RoomGame refactor/cleanup, but
with the bugs (forfeiting BestOfGame, and autojoin) fixed.

This reinstates:

- 6bccd4f622 Fix crash in bestof when expiring battles
- 2a48cbd064 Cleanup more RoomGame implementations

The latter fixes these, in addition to refactoring:
- Fix a race condition when destroying bestof games
- Fix `/tour settings scouting off` error message
2024-01-16 15:54:38 +09:00
Annika
e12df631e8
Fix tests for Room.createBattle change
Commit a07494784a made Room.createBattle return null instead of undefined on failure. This PR updates the unit tests to reflect that.
2024-01-07 20:05:22 -08:00
Guangcong Luo
3c51f8aa1f
Refactor BestOfGame (#10026)
This replaces some pretty jank code with much cleaner code.
Anything that would be more cleanly implemented by iterating the
players array is now done by iterating the players array.

Some instances of p1/p2 are lying around but we should slowly deprecate
them.
2024-01-07 01:45:23 -08:00
Kris Johnson
b04b3d7eb0
Add Pokemon HOME 3.0.0 changes (#9573)
* Add Pokemon HOME 3.0.0 changes

* oop

* a

* OWOWOWOWOWWO
2023-05-30 09:08:02 -06:00
Mia
04cfc02742 Fix extractChannelMessages test 2023-02-26 12:28:43 -06:00
Mr. Sableye
4130d01ad4
Update regex for extracting privileged messages (#9295)
Co-authored-by: Christopher Monsanto <chris@monsan.to>
2023-02-17 18:17:11 -05:00
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Annika
f183998692 CG Teams: Prevent duplicate moves
Fixes #9197
2022-12-16 13:47:33 -08:00
Alexander B
ca8e17109b
Datasearch: Show formes if sorted (#9190) 2022-12-15 19:52:42 -08:00
Annika
589d0689ef Computer-Generated Teams: Initial fixes 2022-12-14 18:45:52 -08:00
Annika
06ad1838b4 Add [Gen 9] Computer-Generated Teams 2022-12-14 17:46:20 -08:00
Alexander B
1d5334432e
Hangman: Prevent impossible guesses, escape HTML (#9033)
* Prevent guessing words with incorrect already revealed indexes

* Clarify hint length and use consts

* Escape HTML on words

* lint

* Hangman: Better testing for invalid guesses

* Hangman: Escape HTML characters

Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2022-11-23 12:50:09 -08:00
Kris Johnson
d50c8c249b
Add Gen 9 (#8997) 2022-11-17 20:46:29 -05:00
sparksblade
c528075dc7
Fix abilitysearch for special char separators (#8872) 2022-08-24 20:49:09 -07:00
Mia
5925f4b7b0
Remove prefix-manager timeout tests 2022-06-17 07:39:12 -05:00
Kris Johnson
758356a55d
Add a timeout for userprefixes (#8667) 2022-02-22 17:44:48 -08:00
Mia
fa8f7a3e50
SQL: Propagate errors to the parent process (#8613) 2022-01-05 17:56:52 -08:00
Annika
57f19246a8 Trivia: Support a cycle-specific leaderboard 2021-12-11 18:13:20 -08:00
Guangcong Luo
7017dcb8f9 Mark tests using IPTools.lookup with "(network)"
(Also mark them with "(slow)" to skip them during a normal `npm test`.)

This is mostly the result of a particularly frustrating debugging
session when I couldn't figure out why these tests were timing out
(it turns out, it was because my DNS was broken so `IPTools.lookup` was
timing out). Marking them with "(network)" should make similar
situations less frustrating in the future.
2021-11-05 21:58:28 -04:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Mia
8cf1035ee2
SQL: Automatically prepare statements unless told otherwise (#8439) 2021-08-18 12:51:39 -07:00
Annika
1a41721aba Trivia: Make unit tests work without SQLite 2021-08-14 20:48:37 -07:00
Annika
0a33b52ad4 Trivia: Use transactions and split into a directory 2021-08-14 20:35:08 -07:00
Annika
dcb96fa7ed Trivia: Refactor to use SQLite as a storage backend 2021-08-14 20:35:08 -07:00
Annika
82a1510564 Modlog: Fix note search testing 2021-08-13 19:00:18 -07:00
Annika
6fdfd74f76 Modlog: Unskip and fix unit tests 2021-08-09 14:42:01 -07:00
Annika
633e061067 Modlog: Remove text logging code 2021-08-09 14:06:14 -07:00
Annika
bcbe100c41
Modlog: Use SQLite for searches (#8004) 2021-07-23 13:47:49 -07:00
Mia
e5fbd64427
Support adding friends (#7333) 2021-07-16 12:56:34 -07:00
Annika
52a9378361 Trivia: Support combining multiple categories 2021-07-13 16:01:03 -07:00
Annika
6ed55b6d1f
IPTools: Add sanity checks (#8331) 2021-07-09 19:59:45 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Annika
c87bf685bb Fix Punishments tests 2021-07-01 16:33:03 -07:00
Annika
a80ce32b1f Punishments: Add broader, more integrated tests 2021-06-29 17:55:45 -07:00
Annika
9d87d9bac2 Fix Punishments#ipSearch 2021-06-08 14:08:36 -07:00
Mia
09e298f15b
Punishments: Support giving multiple punishments to one user (#8265) 2021-05-31 11:06:01 -07:00
Mia
5f9072b2ba
Chat-monitor: Centralize functions and migrate to JSON (#8328) 2021-05-29 22:11:32 -07:00