Skip to content

test: introduce test-vitest-setup project to handle test setup for vite tests #1065

@BioPhoton

Description

@BioPhoton

Introduce test-vitest-setup project to handle test setup for vite tests


PR1

  • Introduce project test-vitest-setup under the testing folder and add configuration. Copy the example linked below and add potential improvements.
    • adjust coverage.reportDirectory to be at project root (packages/<name>/.coverage)
    • add unit tests
    • use existing types see this comment
    • add minimal docs to the test-vitest-setup project on how to use

Example implementation:


PR1.2

  • Extend vitest.{targetName}.config.ts from test-vitest-setup configuration. (consider the changed reportDirectory may be a breaking change for the CI pipeline)
    • unit tests
    • int tests
    • e2e tests

PR2

  • improve test coverage config, exclude index.ts
  • remove vitest executor defaults from nx.json
"@nx/vite:test": {
      "cache": true,
      "inputs": ["default", "test-vitest-inputs"],
      "options": {
        "passWithNoTests": true,
        "watch": false
      }
    },
  • Rename nx-plugin/mock to models/mocks
  • Rename examples/plugins/src/lighthouse/mockto examples/plugins/src/lighthouse/mocks
  • After all folders are renamed to mocks adjust inputs in nx.json
  • Move zod2md.ts under {projectRoot}/tools and make sure "!{projectRoot}/tools/**/*" is added under nx.json#namedInputs.production

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions