Skip to content

Commit 26e8e6d

Browse files
committed
Run more tests in CI
1 parent 8425ada commit 26e8e6d

File tree

9 files changed

+50
-1
lines changed

9 files changed

+50
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"node": ">=22.0.0"
1010
},
1111
"scripts": {
12-
"test": "jest",
12+
"test": "npx turbo test",
13+
"test:integration": "npx turbo run integration-tests",
14+
"test:all": "npx turbo run test integration-tests",
15+
"test:unit": "jest",
1316
"lint": "eslint . --ext ts,tsx,js,jsx --rulesdir=packages/webamp-modern/tools/eslint-rules",
1417
"type-check": "pnpm --filter webamp type-check && pnpm --filter ani-cursor type-check && pnpm --filter skin-database type-check && pnpm --filter webamp-docs type-check && pnpm --filter winamp-eqf type-check",
1518
"deploy": "sh deploy.sh",

packages/skin-database/api/__tests__/graphql.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ beforeEach(async () => {
3030
await knex.seed.run();
3131
});
3232

33+
afterAll(async () => {
34+
await knex.destroy();
35+
});
36+
3337
function gql(templateString: TemplateStringsArray): string {
3438
return templateString[0];
3539
}

packages/skin-database/data/__tests__/ArchiveFileModel.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ beforeEach(async () => {
77
await knex.seed.run();
88
});
99

10+
afterAll(async () => {
11+
await knex.destroy();
12+
});
13+
1014
test("fromMd5", async () => {
1115
const ctx = new UserContext();
1216
const files = await ArchiveFileModel.fromMd5(ctx, "a_fake_md5");

packages/skin-database/data/__tests__/SkinModel.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ beforeEach(async () => {
77
await knex.seed.run();
88
});
99

10+
afterAll(async () => {
11+
await knex.destroy();
12+
});
13+
1014
test("fromMd5", async () => {
1115
const ctx = new UserContext();
1216
const skin = await SkinModel.fromMd5(ctx, "a_fake_md5");

packages/skin-database/data/__tests__/skins.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ beforeEach(async () => {
77
await knex.migrate.latest();
88
});
99

10+
afterAll(async () => {
11+
await knex.destroy();
12+
});
13+
1014
test("empty", async () => {
1115
expect(await Skins.getAllClassicSkins()).toEqual([]);
1216
expect(await Skins.getClassicSkinCount()).toBe(0);

packages/skin-database/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
},
5050
"scripts": {
5151
"lint": "eslint .",
52+
"test": "jest",
5253
"dev": "next dev",
5354
"build": "next build",
5455
"start": "next start",
@@ -72,7 +73,19 @@
7273
"@types/node-fetch": "^2.5.7",
7374
"@typescript-eslint/eslint-plugin": "^7.1.0",
7475
"@typescript-eslint/parser": "^7.1.0",
76+
"@swc/jest": "^0.2.24",
7577
"grats": "^0.0.31",
7678
"typescript": "^5.3.3"
79+
},
80+
"jest": {
81+
"testEnvironment": "node",
82+
"extensionsToTreatAsEsm": [".ts"],
83+
"moduleNameMapper": {
84+
"^(\\.{1,2}/.*)\\.js$": "$1"
85+
},
86+
"transform": {
87+
"^.+\\.(t|j)sx?$": ["@swc/jest"]
88+
},
89+
"setupFiles": ["<rootDir>/jest-setup.js"]
7790
}
7891
}

packages/skin-database/tasks/__tests__/refresh.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ beforeEach(async () => {
1919
await knex.seed.run();
2020
});
2121

22+
afterAll(async () => {
23+
await knex.destroy();
24+
});
25+
2226
test("refresh", async () => {
2327
const ctx = new UserContext();
2428
const [skin] = await getSkinsToRefresh(ctx, 1);

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@
4242
"dependsOn": ["ani-cursor#build", "winamp-eqf#build"],
4343
"outputs": []
4444
},
45+
"webamp-modern#test": {
46+
"outputs": []
47+
},
48+
"skin-database#test": {
49+
"outputs": []
50+
},
51+
"webamp#integration-tests": {
52+
"dependsOn": ["ani-cursor#build", "winamp-eqf#build"],
53+
"outputs": []
54+
},
4555
"webamp#lint": {
4656
"dependsOn": ["ani-cursor#build", "winamp-eqf#build"]
4757
},

0 commit comments

Comments
 (0)