Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
fix(gh-jira): only freeze options object when testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Garant committed Oct 13, 2019
1 parent 11034b5 commit a227cc4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ export async function setUp() {
*/
const args = nopt(Command.DETAILS.options, Command.DETAILS.shorthands, process.argv, 2)

setAutoFreeze(true)
// Allow mutation of options when not testing
// https://immerjs.github.io/immer/docs/freezing
!testing && setAutoFreeze(false)

// Dynamically import test util & start mocking api
if (testing) {
var { prepareTestFixtures } = await import('./utils')

// function to call when our cmd is done running so e2e tests finish
// enable mock apis for e2e's
var cmdDoneRunning = prepareTestFixtures(Command.name, args.argv.cooked)
}
const options = await produce(args, async draft => {
Expand Down

0 comments on commit a227cc4

Please sign in to comment.