Skip to content

Commit bdb3bed

Browse files
authored
update spot tests (#111)
1 parent b5f64d5 commit bdb3bed

File tree

9,758 files changed

+30
-9275770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

9,758 files changed

+30
-9275770
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [ main ]
66
pull_request:
77
workflow_dispatch:
88

@@ -40,6 +40,7 @@ jobs:
4040
- uses: "actions/checkout@v4"
4141
with:
4242
fetch-depth: 0
43+
submodules: recursive
4344
- uses: "./.github/actions/setup"
4445
- run: "just test-server-background"
4546
- run: "./gradlew ${{ matrix.target }}Test"

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "api-data"]
2+
path = api-data
3+
url = https://github.com/pokeapi/api-data

api-data

Submodule api-data added at 4cee360

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set windows-shell := ["C:\\Program Files\\Git\\bin\\sh.exe", "-c"]
33
_default:
44
just --list
55

6-
test-server-cmd := "npx -y http-server src/commonTest/resources/data -e json -p 8080 --cors"
6+
test-server-cmd := "npx -y http-server ./api-data/data -e json -p 8080 --cors"
77

88
# Serve PokeAPI data from static files
99
test-server:

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/EvolutionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class EvolutionTest {
115115
it.evolutionDetails.contains(
116116
EvolutionDetail(
117117
trigger = NamedApiResource("level-up", "evolution-trigger", 1),
118-
minHappiness = 220,
118+
minHappiness = 160,
119119
timeOfDay = "day",
120120
)
121121
)

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/GameTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class GameTest {
7474
LocalPokeApi.getVersionGroup(1).apply {
7575
assertEquals(1, id)
7676
assertEquals("red-blue", name)
77-
assertEquals(1, order)
77+
assertEquals(3, order)
7878
assertEquals(NamedApiResource("generation-i", "generation", 1), generation)
7979
assertContains(moveLearnMethods, NamedApiResource("machine", "move-learn-method", 4))
8080
assertContains(pokedexes, NamedApiResource("kanto", "pokedex", 2))

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/ItemTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ItemTest {
2525
LocalPokeApi.getItem(20).apply {
2626
assertEquals(20, id)
2727
assertEquals("ice-heal", name)
28-
assertEquals(100, cost)
28+
assertEquals(200, cost)
2929
assertEquals(30, flingPower)
3030
assertContains(attributes, NamedApiResource("holdable", "item-attribute", 5))
3131
assertEquals(NamedApiResource("status-cures", "item-category", 30), category)
@@ -103,7 +103,7 @@ class ItemTest {
103103
LocalPokeApi.getItem(305).apply {
104104
assertNotNull(
105105
machines.find { machineVersionDetail ->
106-
machineVersionDetail.machine == ApiResource("machine", 1) &&
106+
machineVersionDetail.machine == ApiResource("machine", 2) &&
107107
machineVersionDetail.versionGroup == NamedApiResource("red-blue", "version-group", 1)
108108
}
109109
)

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/LocationTest.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@ class LocationTest {
3939
fun getLocationArea() = runTest {
4040
LocalPokeApi.getLocationArea(20).apply {
4141
assertEquals(20, id)
42-
assertEquals("mt-coronet-cave", name)
42+
assertEquals("mt-coronet-1f-from-exterior", name)
4343
assertEquals(20, gameIndex)
4444
assertEquals(NamedApiResource("mt-coronet", "location", 10), location)
45-
assertContains(names, Name(name = "cave", language = NamedApiResource("en", "language", 9)))
45+
assertContains(
46+
names,
47+
Name(
48+
name = "Mount Coronet (1F from exterior)",
49+
language = NamedApiResource("en", "language", 9),
50+
),
51+
)
4652
assertNotNull(
4753
encounterMethodRates.find {
4854
it.encounterMethod == NamedApiResource("walk", "encounter-method", 1) &&

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/MachineTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class MachineTest {
1414
assertEquals(18, id)
1515
assertEquals(NamedApiResource("tm01", "item", 305), item)
1616
assertEquals(NamedApiResource("work-up", "move", 526), move)
17-
assertEquals(NamedApiResource("ultra-sun-ultra-moon", "version-group", 18), versionGroup)
17+
assertEquals(NamedApiResource("sun-moon", "version-group", 17), versionGroup)
1818
}
1919
}
2020
}

src/commonTest/kotlin/dev/sargunv/pokekotlin/test/model/MoveTest.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ class MoveTest {
2828
assertContains(
2929
effectEntries,
3030
VerboseEffect(
31-
effect =
32-
"Inflicts regular damage. Has a \$effect_chance% chance to paralyze" + " the target.",
33-
shortEffect = "Has a \$effect_chance% chance to paralyze the target.",
31+
effect = "Inflicts regular damage. Has a 30% chance to paralyze the target.",
32+
shortEffect = "Has a 30% chance to paralyze the target.",
3433
language = NamedApiResource("en", "language", 9),
3534
),
3635
)
@@ -64,7 +63,7 @@ class MoveTest {
6463
assertContains(
6564
machines,
6665
MachineVersionDetail(
67-
machine = ApiResource("machine", 127),
66+
machine = ApiResource("machine", 142),
6867
versionGroup = NamedApiResource("red-blue", "version-group", 1),
6968
),
7069
)

0 commit comments

Comments
 (0)