Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove depercated global option in favor of globals #970

Merged
merged 3 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/index.md
Expand Up @@ -111,8 +111,8 @@ You can specify additional CLI options like `--port` or `--https`. For a full li
| `--outputFile <filename>` | Write test results to a file when the `--reporter=json` or `--reporter=junit` option is also specified |
| `--coverage` | Use c8 for coverage |
| `--run` | Do not watch |
| `--mode` | Override Vite mode (default: `test`) |
| `--mode <name>` | Override Vite mode (default: `test`) |
| `--global` | Inject APIs globally `deprecated` use `--globals` |
| `--globals` | Inject APIs globally |
| `--dom` | Mock browser api with happy-dom |
| `--environment <env>` | Runner environment (default: `node`) |
Expand Down
3 changes: 0 additions & 3 deletions packages/vitest/package.json
Expand Up @@ -32,9 +32,6 @@
"types": "./dist/index.d.ts"
},
"./*": "./*",
"./global": {
"types": "./globals.d.ts"
},
"./globals": {
"types": "./globals.d.ts"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/vitest/src/node/config.ts
Expand Up @@ -78,14 +78,10 @@ export function resolveConfig(
options.environment = 'happy-dom'
}

const globals = options?.global ?? options.globals

const resolved = {
...configDefaults,
...options,
root: viteConfig.root,
globals,
global: globals,
} as ResolvedConfig

if (viteConfig.base !== '/')
Expand Down
5 changes: 0 additions & 5 deletions packages/vitest/src/types/config.ts
Expand Up @@ -92,11 +92,6 @@ export interface InlineConfig {
*/
globals?: boolean

/**
* @deprecated
*/
global?: boolean

/**
* Running environment
*
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Expand Up @@ -19,7 +19,6 @@
"#types": ["./packages/vitest/src/index.ts"],
"~/*": ["./packages/ui/client/*"],
"vitest": ["./packages/vitest/src/index.ts"],
"vitest/global": ["./packages/vitest/global.d.ts"],
"vitest/globals": ["./packages/vitest/globals.d.ts"],
"vitest/node": ["./packages/vitest/src/node/index.ts"],
"vitest/config": ["./packages/vitest/src/config.ts"],
Expand Down