Skip to content

Commit 3a7f143

Browse files
authored
fix(devtools): don't enable devtools when in test mode (#532)
1 parent b289950 commit 3a7f143

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/devtools/src/integrations/plugin-metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NuxtDevtoolsServerContext } from '../types'
22

33
export async function setup({ nuxt }: NuxtDevtoolsServerContext) {
4-
if (!nuxt.options.dev)
4+
if (!nuxt.options.dev || nuxt.options.test)
55
return
66

77
/**

packages/devtools/src/integrations/vue-inspector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import VueInspector from 'vite-plugin-vue-inspector'
44
import type { NuxtDevtoolsServerContext } from '../types'
55

66
export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {
7-
if (!nuxt.options.dev)
7+
if (!nuxt.options.dev || nuxt.options.test)
88
return
99

1010
addVitePlugin(VueInspector({

packages/devtools/src/module-main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function enableModule(options: ModuleOptions, nuxt: Nuxt) {
2727
return
2828
}
2929

30-
if (!nuxt.options.dev) {
30+
if (!nuxt.options.dev || nuxt.options.test) {
3131
if (nuxt.options.build.analyze)
3232
await import('./integrations/analyze-build').then(({ setup }) => setup(nuxt, options))
3333
return

playgrounds/module-starter/playground/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default defineNuxtConfig({
1616
*/
1717
defineNuxtModule({
1818
setup(_, nuxt) {
19-
if (!nuxt.options.dev)
19+
if (!nuxt.options.dev || nuxt.options.test)
2020
return
2121

2222
const _process = startSubprocess(

0 commit comments

Comments
 (0)