Skip to content

Commit ad18f1e

Browse files
authored
set up justfile with testing commands (#113)
1 parent 702c298 commit ad18f1e

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ end_of_line = lf
55
insert_final_newline = true
66
indent_style = space
77
indent_size = 2
8+
9+
[justfile]
10+
indent_size = 4

justfile

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,47 @@ 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 ./api-data/data -e json -p 8080 --cors"
7-
86
# Serve PokeAPI data from static files
97
test-server:
10-
{{ test-server-cmd }}
8+
./scripts/test-server
119

1210
# Spawn a background job serving PokeAPI data from static files
1311
test-server-background:
14-
{{ test-server-cmd }} &
12+
./scripts/test-server &
13+
14+
format:
15+
./gradlew spotlessApply
16+
17+
test-jvm:
18+
./gradlew jvmTest
19+
20+
test-js-browser:
21+
./gradlew jsBrowserTest
22+
23+
test-js-node:
24+
./gradlew jsNodeTest
25+
26+
test-wasm-browser:
27+
./gradlew wasmBrowserTest
28+
29+
test-wasm-node:
30+
./gradlew wasmNodeTest
31+
32+
native-desktop-task := (
33+
if os() == "macos" { "macosArm64Test" }
34+
else if os() == "linux" { "linuxX64Test" }
35+
else if os() == "windows" { "mingwX64Test" }
36+
else { error("Unrecognized OS: " + os()) }
37+
)
38+
39+
test-native-desktop:
40+
./gradlew {{ native-desktop-task }}
41+
42+
test-native-ios:
43+
./gradlew iosSimulatorArm64Test
44+
45+
test-native-tvos:
46+
./gradlew tvosSimulatorArm64Test
47+
48+
test-native-watchos:
49+
./gradlew watchosSimulatorArm64Test

scripts/test-server

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
npx -y http-server ./api-data/data -e json -p 8080 --cors

0 commit comments

Comments
 (0)