Skip to content

Commit

Permalink
fix: process.cmd maybe undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Apr 29, 2023
1 parent ad00fce commit 39b9c9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mighty-clouds-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mocktomata': patch
---

support `global.process.cwd` might be undefined.
2 changes: 1 addition & 1 deletion packages/mocktomata/ts/browser/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { requiredDeep, RequiredPick } from 'type-plus'
export function createContext(options?: { io?: Mocktomata.IO; log?: Logger }) {
const configurator = createConfigurator()

const cwd = global.process?.cwd()
const cwd = global.process?.cwd?.()
const port = 3698
const url = `http://localhost:${port}`
const stackContext = createStackFrameContext({
Expand Down

0 comments on commit 39b9c9e

Please sign in to comment.