google / timesketch

Collaborative forensic timeline analysis
Apache License 2.0
2.52k stars 577 forks source link

Setup frontend unit tests with vitest #3013

Closed Annoraaq closed 5 months ago

Annoraaq commented 5 months ago

Introduce Vitest and add first tests.

Note that the tsdev.sh script has been updated. You can also run the tests outside of docker using yarn test. Just make sure you have an up to date Node version.

I had to add file endings to the imports to make the tests work. This seems to be the preferred way, since vue-cli will also stop supporting extension-less Vue imports (https://github.com/vitejs/vite/issues/178#issuecomment-630138450).

I further moved the EventBus into an own file to make the tests run.