Skip to content

Commit

Permalink
fix(devtools): don't enable devtools when in test mode (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Dec 6, 2023
1 parent b289950 commit 3a7f143
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/devtools/src/integrations/plugin-metrics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NuxtDevtoolsServerContext } from '../types'

export async function setup({ nuxt }: NuxtDevtoolsServerContext) {
if (!nuxt.options.dev)
if (!nuxt.options.dev || nuxt.options.test)
return

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/src/integrations/vue-inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import VueInspector from 'vite-plugin-vue-inspector'
import type { NuxtDevtoolsServerContext } from '../types'

export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {
if (!nuxt.options.dev)
if (!nuxt.options.dev || nuxt.options.test)
return

addVitePlugin(VueInspector({
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/src/module-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function enableModule(options: ModuleOptions, nuxt: Nuxt) {
return
}

if (!nuxt.options.dev) {
if (!nuxt.options.dev || nuxt.options.test) {
if (nuxt.options.build.analyze)
await import('./integrations/analyze-build').then(({ setup }) => setup(nuxt, options))
return
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/module-starter/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineNuxtConfig({
*/
defineNuxtModule({
setup(_, nuxt) {
if (!nuxt.options.dev)
if (!nuxt.options.dev || nuxt.options.test)
return

const _process = startSubprocess(
Expand Down

0 comments on commit 3a7f143

Please sign in to comment.