Skip to content

Commit 0214184

Browse files
committed
refactor: simplify the tests
1 parent 7018525 commit 0214184

File tree

2 files changed

+3
-11
lines changed
  • sources/academy/webscraping

2 files changed

+3
-11
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
setup() {
2-
DIR=sources/academy/webscraping/scraping_basics_javascript/exercises
3-
}
4-
51
@test "outputs the HTML with Star Wars products" {
6-
run npx node "$DIR/lego.mjs"
2+
run npx node "$BATS_TEST_DIRNAME/lego.mjs"
73
[[ "$output" == *"Millennium Falcon"* ]]
84
}
95

106
@test "outputs the number of F1 Academy teams" {
11-
run npx --package=cheerio node "$DIR/f1academy_teams.mjs"
7+
run npx --package=cheerio node "$BATS_TEST_DIRNAME/f1academy_teams.mjs"
128
[[ "$output" == "6" ]]
139
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
setup() {
2-
DIR=sources/academy/webscraping/scraping_basics_python/exercises
3-
}
4-
51
@test "outputs the HTML with Star Wars products" {
6-
run uv run --with httpx python "$DIR/lego.py"
2+
run uv run --with httpx python "$BATS_TEST_DIRNAME/lego.py"
73
[[ "$output" == *"Millennium Falcon"* ]]
84
}

0 commit comments

Comments
 (0)