Skip to content

Build your personal knowledge base with Trilium Notes

chore(monorepo/server): reintroduce tests

Elian Doran6aa6597cb1d7
diff --git a/_regroup/integration-tests/db/document.db b/_regroup/integration-tests/db/document.db
deleted file mode 100644
index c02b60d345..0000000000
Binary files a/_regroup/integration-tests/db/document.db and /dev/null differ
diff --git a/_regroup/package.json b/_regroup/package.json
index f9faa2831e..545f53b67b 100644
--- a/_regroup/package.json
+++ b/_regroup/package.json
@@ -30,9 +30,7 @@
"docs:build": "typedoc",
"build:clean": "rimraf ./dist ./build",
"build:prepare-dist": "npm run build:clean && npm run build:ts && npm run build:webpack && tsx ./bin/copy-dist.ts",
- "test": "npm run client:test && npm run server:test",
- "server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest",
- "server:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --coverage",
+ "test": "npm run client:test && npm run server:test",
"client:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app",
"client:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app --coverage",
"test:playwright": "playwright test --workers 1",
diff --git a/apps/server/.gitignore b/apps/server/.gitignore
index 155d939595..0968122d49 100644
--- a/apps/server/.gitignore
+++ b/apps/server/.gitignore
@@ -1,3 +1,5 @@
node_modules
build
-data
\ No newline at end of file
+data
+data-integration
+!data-integration/document.db
\ No newline at end of file
diff --git a/apps/server/package.json b/apps/server/package.json
index 30a9faefa2..80b8d4bb59 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -20,7 +20,9 @@
"main": "index.js",
"scripts": {
"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:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./data-integration TRILIUM_INTEGRATION_TEST=memory vitest --coverage"
},
"dependencies": {
"express": "4.21.2",