Skip to content

Commit 5d59ecd

Browse files
authored
Move remaining non-loot-core packages to latest vitest (#4856)
* Move remaining non-loot-core packages to vitest * Add release notes
1 parent 54d9f0f commit 5d59ecd

File tree

10 files changed

+36
-389
lines changed

10 files changed

+36
-389
lines changed

packages/api/__snapshots__/methods.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`API setup and teardown successfully loads budget 1`] = `
3+
exports[`API setup and teardown > successfully loads budget 1`] = `
44
[
55
"2016-10",
66
"2016-11",

packages/api/jest.config.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/api/methods.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import * as api from './index';
66

77
const budgetName = 'test-budget';
88

9-
beforeEach(async () => {
10-
// we need real datetime if we are going to mix new timestamps with our mock data
11-
global.restoreDateNow();
9+
global.IS_TESTING = true;
1210

11+
beforeEach(async () => {
1312
const budgetPath = path.join(__dirname, '/mocks/budgets/', budgetName);
1413
await fs.rm(budgetPath, { force: true, recursive: true });
1514

packages/api/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
],
1515
"scripts": {
1616
"build:app": "yarn workspace loot-core build:api",
17+
"build:crdt": "yarn workspace @actual-app/crdt build",
1718
"build:node": "tsc --p tsconfig.dist.json && tsc-alias -p tsconfig.dist.json",
1819
"build:migrations": "cp migrations/*.sql dist/migrations",
1920
"build:default-db": "cp default-db.sqlite dist/",
2021
"build": "yarn run clean && yarn run build:app && yarn run build:node && yarn run build:migrations && yarn run build:default-db",
21-
"test": "yarn run build:app && jest -c jest.config.js",
22+
"test": "yarn run build:app && yarn run build:crdt && vitest",
2223
"clean": "rm -rf dist @types"
2324
},
2425
"dependencies": {
@@ -29,12 +30,9 @@
2930
"uuid": "^9.0.1"
3031
},
3132
"devDependencies": {
32-
"@swc/core": "^1.5.3",
33-
"@swc/jest": "^0.2.36",
34-
"@types/jest": "^29.5.14",
3533
"@types/uuid": "^9.0.8",
36-
"jest": "^29.7.0",
3734
"tsc-alias": "^1.8.11",
38-
"typescript": "^5.8.2"
35+
"typescript": "^5.8.2",
36+
"vitest": "^3.0.2"
3937
}
4038
}

packages/api/vitest.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
test: {
3+
globals: true,
4+
onConsoleLog(log: string, type: 'stdout' | 'stderr'): boolean | void {
5+
// print only console.error
6+
return type === 'stderr';
7+
},
8+
},
9+
};

packages/desktop-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"vite": "^5.4.18",
8181
"vite-plugin-pwa": "^0.20.5",
8282
"vite-tsconfig-paths": "^4.3.2",
83-
"vitest": "^1.6.1",
83+
"vitest": "^3.0.2",
8484
"webpack": "^5.98.0",
8585
"webpack-bundle-analyzer": "^4.10.2",
8686
"xml2js": "^0.6.2"

packages/desktop-client/vite.config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ export default defineConfig(async ({ mode }) => {
194194
environment: 'jsdom',
195195
globals: true,
196196
setupFiles: './src/setupTests.js',
197+
onConsoleLog(log: string, type: 'stdout' | 'stderr'): boolean | void {
198+
// print only console.error
199+
return type === 'stderr';
200+
},
197201
},
198202
};
199203
});

packages/eslint-plugin-actual/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"eslint-plugin-eslint-plugin": "^6.4.0",
1616
"eslint-plugin-node": "^11.1.0",
1717
"eslint-vitest-rule-tester": "^2.1.0",
18-
"vitest": "^1.6.1"
18+
"vitest": "^3.0.2"
1919
},
2020
"peerDependencies": {
2121
"eslint": ">=7"

upcoming-release-notes/4856.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Maintenance
3+
authors: [jfdoming]
4+
---
5+
6+
Move api/desktop-client/eslint-plugin-actual to the newest vitest

0 commit comments

Comments
 (0)