Skip to content

Commit

Permalink
(newapp) Use jest.config.ts for Typescript apps (#2663)
Browse files Browse the repository at this point in the history
* Convert app template Jest config to TypeScript

* Add config for JS users

* Update packages/generator/templates/app/README.md

* Update packages/generator/templates/app/README.md

Co-authored-by: Brandon Bayer <[email protected]>
  • Loading branch information
ratson and flybayer authored Aug 30, 2021
1 parent 3936039 commit 962b521
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/generator/src/generators/app-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export class AppGenerator extends Generator<AppGeneratorOptions> {

filesToIgnore() {
if (!this.options.useTs) {
return ["tsconfig.json", "blitz-env.d.ts"]
return ["tsconfig.json", "blitz-env.d.ts", "jest.config.ts"]
}
return ["jsconfig.json"]
return ["jsconfig.json", "jest.config.js"]
}

async getTemplateValues() {
Expand Down
7 changes: 7 additions & 0 deletions packages/generator/templates/app/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Config } from "@jest/types"

const config: Config.InitialOptions = {
preset: "blitz",
}

export default config

0 comments on commit 962b521

Please sign in to comment.