Skip to content

Commit

Permalink
setup vitest for api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielres committed Apr 20, 2023
1 parent 2851b4a commit f880e3e
Show file tree
Hide file tree
Showing 3 changed files with 626 additions and 329 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest",
"test:api": "vitest -c vitest.config.api.ts",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
Expand All @@ -22,13 +23,15 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"jiti": "^1.18.2",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.2.0",
"vite-test-utils": "^0.6.0",
"vitest": "^0.25.3"
},
"type": "module"
Expand Down

1 comment on commit f880e3e

@danielres
Copy link
Owner Author

@danielres danielres commented on f880e3e Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • jiti is needed by vite-test-utils
  • if we want to run api tests separately from unit tests, this can be accomplished by giving them a different extension (for ex: .test.api.ts instead of .test.ts), and using a custom config with a custom include setting.

Please sign in to comment.