Commit Graph

13 Commits

Author SHA1 Message Date
Guangcong Luo
884dfee923 Fix issues identified by LGTM
Out of 12 issues found:

3 bugs:

- duplicate property - caught a bug in Gen 1 Light Screen
- duplicate property - caught a bug in Gen 1 Reflect
- unused variable - caught a bug in type animations

7 harmless but good for code quality:

- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- duplicate case - harmless but important for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but important for code quality

2 not-bugs that had to be worked around:

- unused variable - used for an `eval` trick, had to use a workaround
- unused variable - used for readable destructuring

I think on balance, LGTM does more good than bad. Catching bugs early
is worth some amount of hassle.

(Also like half these problems are problems tslint could catch if I
actually bothered to set it up...)
2018-11-15 18:52:36 -06:00
Guangcong Luo
2721c0b8a0 Drop BattleLog dependency from headless Battles
Mostly, this involves removing `BattleLog.escapeHTML` from `battle.ts`.
All previous use-cases have been replaced with something like
`Tools.sanitizeName`.

Technically, the dependency remains for `|controlshtml|` and
`|fieldhtml|`, but these will be dropped for BattleRoom/GameRoom
separation, to be done in the Preact rewrite.
2018-11-15 18:52:36 -06:00
Guangcong Luo
d4a73e74d4 Add script for testing the new battle parser
(Run `./test/parse` and pipe protocol messages to stdin.)
2018-11-15 18:52:36 -06:00
Guangcong Luo
bf002f9450 Split battle-log.ts off from battle-dex.ts
This splits battle-dex.ts up into:

- `battle-dex.ts`
  - dex data access, misc tools
- `battle-log.ts`
  - manipulating HTML, especially in battle logs

This turned out to be a pretty significant portion of what was
previously battle-dex.
2018-11-15 18:52:36 -06:00
Guangcong Luo
f86245febb Add mocha tests to npm test 2018-10-16 03:31:27 -05:00
Guangcong Luo
fb4f83a580 Remove testcafe dependency
It was unused and vulnerable.
2018-10-16 03:04:52 -05:00
Dan Huang
ee91a72dc6 Support headless client Battle (#1151) 2018-10-16 02:48:59 -05:00
Guangcong Luo
a0421462c8 Comment out VGC teambuilder test 2017-11-23 01:39:06 -06:00
Konrad Borowski
ccf4621c7d Use different Pokemon in tests to avoid failures
I would prefer if the test would still test if a mega gets an item,
which is why Charizard-Mega-Y was picked. It's unlikely to be banned,
but is powerful enough to stay in OU.

A safer choice would be an Arceus, but there is no code yet that
automatically gives a correct item to formes (may be worth fixing).
2017-08-07 22:53:54 +02:00
asgdf
8eb42e83b3 Allow export of the 'uncategorized' format folder (#976) 2017-08-02 20:29:18 -04:00
Konrad Borowski
f41ef9d245 Test if Trump Card has 5 PP (#965)
Test if Trump Card has 5 PP

This I believe was a regression that was fixed by 2fac7642f6.
2017-07-06 20:31:51 -05:00
Konrad Borowski
cfd87a91c1 Add level 50 Pokemon test for VGC (#964) 2017-07-06 15:34:20 +09:00
Konrad Borowski
156b5bf3d5 Add testclient unit tests (#957) 2017-06-27 17:43:54 -07:00