-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dapp): add jest config under dapp; remove dead tests
- Loading branch information
Showing
6 changed files
with
34 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type {Config} from 'jest'; | ||
import nextJest from 'next/jest.js' | ||
|
||
const createJestConfig = nextJest({ | ||
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment | ||
dir: './', | ||
}) | ||
|
||
const esModules = ['isows'].join('|'); | ||
|
||
const config: Config = { | ||
coverageProvider: 'v8', | ||
preset: "ts-jest", | ||
rootDir: ".", | ||
setupFilesAfterEnv: ["<rootDir>/test/setupTests.ts"], | ||
testEnvironment: 'jsdom', | ||
testMatch: ["<rootDir>/test/**/*.test.(ts|tsx)"], | ||
transform: { | ||
[`(${esModules}).+\.js$`]: "babel-jest", | ||
"^.+\.(ts|tsx)$": [ | ||
"ts-jest", { | ||
tsconfig: "<rootDir>/tsconfig.test.json" | ||
} | ||
], | ||
}, | ||
transformIgnorePatterns: [`/node_modules/(?!${esModules})`], | ||
verbose: true, | ||
} | ||
|
||
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async | ||
export default createJestConfig(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import '@testing-library/jest-dom'; | ||
import { TextEncoder, TextDecoder } from 'util'; | ||
|
||
Object.assign(global, { TextDecoder, TextEncoder }); |