refs D451
Details
- Reviewers
- None
- Commits
- rP19954: Add unit tests for DeathDamage component. Refs rP19950.
./binaries/system/test
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | ||
---|---|---|
12 ↗ | (On Diff #3031) | Ternary maybe ? |
27 ↗ | (On Diff #3031) | Damages → Damage unless you are talking about “money claimed by, or ordered to be paid to, a person as compensation for loss or injury” source https://blog.harwardcommunications.com/2011/02/21/the-difference-between-damage-and-damages/ |
39 ↗ | (On Diff #3031) | It's not mandatory but I think it's good to follow the json notation and add quotes around properties so that CauseSplashDamage: becomes → "CauseSplashDamage:" same for the other lines. |
Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 40| » GetPlayersToDamage:·(owner,·friendlyFire)·=>·playersToDamage | | [NORMAL] ESLintBear (no-shadow): | | 'owner' is already declared in the upper scope. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 11| » » return·stat·+·200 | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 13| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 15| let·deadEnt·=·60; | | [NORMAL] JSHintBear: | | 'deadEnt' was used before it was defined. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 25| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 35| let·playersToDamage·=·[2,·3,·7] | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 52| let·result·=·{ | | [NORMAL] JSHintBear: | | 'result' was used before it was defined. Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/356/ for more details.
binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | ||
---|---|---|
60 ↗ | (On Diff #3032) | -1 tab |
Maybe we should check that surrounding entities actually get damaged ? (How much damage they get should be tested in damage.js though)
Also I'm not sure on how you could test that a warning is thrown if there is no owner (because apparently that's not a problem).
binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | ||
---|---|---|
60 ↗ | (On Diff #3032) | yep, bot noticed it too |
Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 40| » "GetPlayersToDamage":·(owner,·friendlyFire)·=>·playersToDamage | | [NORMAL] ESLintBear (no-shadow): | | 'owner' is already declared in the upper scope. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 11| » » return·stat·+·200 | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 13| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 15| let·deadEnt·=·60; | | [NORMAL] JSHintBear: | | 'deadEnt' was used before it was defined. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 25| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 35| let·playersToDamage·=·[2,·3,·7] | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 52| let·result·=·{ | | [NORMAL] JSHintBear: | | 'result' was used before it was defined. Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/357/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1809/ for more details.
Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 16| } | | [NORMAL] JSHintBear: | | Missing semicolon. Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/358/ for more details.
Extra lint:
Executing section JS... | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /media/LiExtend/0ADPhabsvn/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | |++++| /media/LiExtend/0ADPhabsvn/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js | 33| 33| let cmpDeathDamage = ConstructComponent(deadEnt, "DeathDamage", template); | 34| 34| | 35| 35| let playersToDamage = [2, 3, 7]; | 36| |-let pos = new Vector2D(3,4.2); | | 36|+let pos = new Vector2D(3, 4.2); | 37| 37| | 38| 38| let result = { | 39| 39| "attacker": deadEnt,
I just installed the linter on my local machine and added some more options which I proposed in D213 (and which will hopefully applied to the public linter soon) ;P
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1810/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/359/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1811/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/360/ for more details.
Build has FAILED
Link to build: http://jw:8080/job/phabricator/1812/
See console output for more information: http://jw:8080/job/phabricator/1812/console
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/361/ for more details.
Build has FAILED
Link to build: http://jw:8080/job/phabricator/1813/
See console output for more information: http://jw:8080/job/phabricator/1813/console
Build has FAILED
Link to build: http://jw:8080/job/phabricator/1814/
See console output for more information: http://jw:8080/job/phabricator/1814/console