Skip to content

Migrate frontend unit tests to Vitest #670

@LoTerence

Description

@LoTerence

Story

As a developers, we should have reliable unit tests for the frontend so that we can detect bugs early and ensure that new changes don't introduce unintended consequences.

Overview

We recently migrated from CRA+Webpack to Vite, which means that our old unit tests in Jest will no longer be effective. Vite does not have out of box support for Jest. We should migrate our Jest unit tests to Vitest.

Lastly, some old unit tests are outdated because they tested old Design System UI components. We need to audit them to see if they are still relevant for testing updated UI components.

  • For example, this PR about Checkbox component introduces a totally new tailwind Checkbox, but does not update the old jest tests for the old sass Checkbox, so they may fail when trying to test it.

Action Items

  • Migrate all Jest unit tests to Vitest
  • Audit old unit tests with updated tailwind UI components
  • Make sure npm run test is fully functional
  • Write documentation about how frontend unit tests work on our app

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    📋 Prioritized Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions