Younes Jaaidi 77dc090a75
feat(vite): add angular option to vitest generator (#29055)
## Current Behavior

`@nx/vite:vitest` generator does not provide Angular support in the
`uiFramework` options.

## Expected Behavior

`angular` option should generate the vitest configuration just like
`@nx/angular:application` and `@nx/angular/library` do.
2024-12-11 13:42:12 +00:00

75 lines
2.5 KiB
JSON

{
"name": "vitest",
"factory": "./src/generators/vitest/vitest-generator#vitestGeneratorInternal",
"schema": {
"$schema": "https://json-schema.org/schema",
"cli": "nx",
"$id": "Vitest",
"title": "Vitest",
"type": "object",
"description": "Generate a Vitest setup for a project.",
"properties": {
"project": {
"type": "string",
"description": "The name of the project to test.",
"$default": { "$source": "projectName" }
},
"uiFramework": {
"type": "string",
"enum": ["angular", "react", "none"],
"description": "UI framework to use with vitest."
},
"inSourceTests": {
"type": "boolean",
"default": false,
"description": "Do not generate separate spec files and set up in-source testing."
},
"skipViteConfig": {
"type": "boolean",
"default": false,
"description": "Skip generating a vite config file."
},
"coverageProvider": {
"type": "string",
"enum": ["v8", "istanbul", "custom"],
"default": "v8",
"description": "Coverage provider to use."
},
"testTarget": {
"type": "string",
"description": "The test target of the project to be transformed to use the @nx/vite:test executor.",
"hidden": true
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"testEnvironment": {
"description": "The vitest environment to use. See https://vitest.dev/config/#environment.",
"type": "string",
"enum": ["node", "jsdom", "happy-dom", "edge-runtime"]
},
"runtimeTsconfigFileName": {
"type": "string",
"description": "The name of the project's tsconfig file that includes the runtime source files. If not provided, it will default to `tsconfig.lib.json` for libraries and `tsconfig.app.json` for applications."
},
"compiler": {
"type": "string",
"enum": ["babel", "swc"],
"default": "babel",
"description": "The compiler to use"
}
},
"required": ["project"],
"presets": []
},
"description": "Generate a vitest configuration.",
"implementation": "/packages/vite/src/generators/vitest/vitest-generator#vitestGeneratorInternal.ts",
"aliases": [],
"hidden": false,
"path": "/packages/vite/src/generators/vitest/schema.json",
"type": "generator"
}