mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
chore(monorepo/server): improve running of tests
This commit is contained in:
parent
6aa6597cb1
commit
eecf984d35
@ -21,8 +21,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build:ts": "tsc",
|
"build:ts": "tsc",
|
||||||
"server:start": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nodemon src/main.ts",
|
"server:start": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nodemon src/main.ts",
|
||||||
"server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./data-integration TRILIUM_INTEGRATION_TEST=memory vitest",
|
"server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./spec/data TRILIUM_INTEGRATION_TEST=memory vitest",
|
||||||
"server:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./data-integration TRILIUM_INTEGRATION_TEST=memory vitest --coverage"
|
"server:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./spec/data TRILIUM_INTEGRATION_TEST=memory vitest --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "4.21.2",
|
"express": "4.21.2",
|
||||||
|
@ -8,7 +8,7 @@ describe("Migration", () => {
|
|||||||
it("migrates from v214", async () => {
|
it("migrates from v214", async () => {
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
cls.init(async () => {
|
cls.init(async () => {
|
||||||
sql.rebuildIntegrationTestDatabase("test/db/document_v214.db");
|
sql.rebuildIntegrationTestDatabase("spec/db/document_v214.db");
|
||||||
await migration.migrateIfNecessary();
|
await migration.migrateIfNecessary();
|
||||||
expect(sql.getValue("SELECT count(*) FROM blobs")).toBe(116);
|
expect(sql.getValue("SELECT count(*) FROM blobs")).toBe(116);
|
||||||
resolve();
|
resolve();
|
||||||
|
16
apps/server/vitest.config.ts
Normal file
16
apps/server/vitest.config.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
import { configDefaults, coverageConfigDefaults } from "vitest/config";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
exclude: [
|
||||||
|
...configDefaults.exclude,
|
||||||
|
"build/**"
|
||||||
|
],
|
||||||
|
coverage: {
|
||||||
|
reporter: [ "text", "html" ],
|
||||||
|
include: ["src/**"],
|
||||||
|
exclude: ["src/public/**"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user