Skip to content

Commit

Permalink
fix: remove depercated global option in favor of globals (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 29, 2022
1 parent 3326332 commit 2d662ec
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 14 deletions.
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

0 comments on commit 2d662ec

Please sign in to comment.