Skip to content

Commit

Permalink
fix blitz generate --dry-run flag not being respected (#2858)
Browse files Browse the repository at this point in the history
(patch)
  • Loading branch information
beerose authored Oct 19, 2021
1 parent 4e6f829 commit 6f37571
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/cli/test/commands/new.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ describe("`new` command", () => {
})
})

testIfNotWindows("accepts --dry-run flag and doesn't create files", async () => {
const newAppDir = fs.mkdtempSync(path.join(tempDir, "full-install-"))
await whileStayingInCWD(() => New.run([newAppDir, "--skip-upgrade", "--dry-run"]))

expect(fs.existsSync(newAppDir)).toBe(true)
expect(fs.existsSync(path.join(newAppDir, "package.json"))).toBe(false)
expect(stdout.output).toContain("Would create")
})

it("fetches latest version from template", async () => {
const expectedVersion = "3.0.0"
const templatePackage = {name: "eslint-plugin-react-hooks", version: "3.x"}
Expand Down
1 change: 1 addition & 0 deletions packages/generator/src/conflict-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ConflictChecker extends Transform {
super({
objectMode: true,
})
this.options = options
}

_transform(file: File, _encoding: string, cb: TransformCallback): void {
Expand Down

0 comments on commit 6f37571

Please sign in to comment.