Skip to content

Commit

Permalink
fix: console.Console is undefined (close: vitest-dev#1877) vitest-dev…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Aug 23, 2022
1 parent baf5e75 commit f5f601a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/vitest/src/integrations/env/node.ts
@@ -1,10 +1,16 @@
import { Console } from 'console'
import type { Environment } from '../../types'
import { populateGlobal } from './utils'

export default <Environment>({
name: 'node',
async setup() {
async setup(global) {
const { console } = global
console.Console = Console
populateGlobal(global, { console })
return {
teardown() {
teardown(global) {
delete global.console.Console
},
}
},
Expand Down

0 comments on commit f5f601a

Please sign in to comment.