Skip to content

Commit ddd081a

Browse files
chore(scripts): run data tests on validate script (#2379)
run data tests on pnpm validate
1 parent bea4348 commit ddd081a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "tsc --incremental",
1111
"watch": "tsc --build --watch",
1212
"lint": "oxlint --type-aware",
13-
"validate": "npm run format:check && npm run lint",
13+
"validate": "npm run format:check && npm run test && npm run lint",
1414
"seed": "NODE_ENV=development tsx src/scripts/seed.ts",
1515
"test": "vitest run"
1616
},

test/wordle.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { readFileSync } from "node:fs";
22
import { expect, test } from "vitest";
33

4-
const wordleWords: string[] = readFileSync("data/wordle.txt", "utf-8").trim().split("\n");
4+
// remove \r for windows
5+
const wordleWords: string[] = readFileSync("data/wordle.txt", "utf-8").trim().replaceAll("\r", "").split("\n");
56

6-
const wordleGuesses: string[] = readFileSync("data/wordle_guesses.txt", "utf-8").trim().split("\n");
7+
const wordleGuesses: string[] = readFileSync("data/wordle_guesses.txt", "utf-8").trim().replaceAll("\r", "").split("\n");
78

89
test("wordle.txt - every word should be 5 characters and lowercase", () => {
910
for (const word of wordleWords) {

0 commit comments

Comments
 (0)