-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swap to ts-node and attempt to get storybook tests working
- Loading branch information
1 parent
9d28c3f
commit c45ff5b
Showing
9 changed files
with
308 additions
and
98 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": ["@yext/slapshot/typescript-react", "plugin:storybook/recommended"], | ||
"ignorePatterns": ["lib", "tests/setup/responses", "storybook-static", "!.storybook"], | ||
"overrides": [{ | ||
"files": ["**/*.{test,stories}.*"], | ||
"rules": { | ||
"react-perf/jsx-no-new-array-as-prop": "off", | ||
"react-perf/jsx-no-new-function-as-prop": "off", | ||
"react-perf/jsx-no-new-object-as-prop": "off" | ||
} | ||
}] | ||
} |
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 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 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,63 @@ | ||
import type { Config } from 'jest'; | ||
|
||
const config: Config = { | ||
bail: 0, | ||
verbose: true, | ||
collectCoverage: true, | ||
collectCoverageFrom: [ | ||
"src/**", | ||
"!src/models/**" | ||
], | ||
coverageDirectory: "coverage/unit", | ||
moduleFileExtensions: [ | ||
"js", | ||
"ts", | ||
"jsx", | ||
"tsx" | ||
], | ||
moduleDirectories: [ | ||
"node_modules", | ||
"<rootDir>" | ||
], | ||
setupFilesAfterEnv: [ | ||
"<rootDir>/tests/__setup__/setup-env.ts" | ||
], | ||
testEnvironment: "jsdom", | ||
testMatch: [ | ||
"<rootDir>/tests/**/*.test.ts?(x)" | ||
], | ||
testPathIgnorePatterns: [ | ||
"<rootDir>/tests/__setup__/*", | ||
"<rootDir>/tests/__fixtures__/*" | ||
], | ||
transformIgnorePatterns: [ | ||
"/node_modules/(?!(@yext/search-headless-react)/|lodash-es)" | ||
], | ||
moduleNameMapper: { | ||
"^(.+)\\.js$": "$1", | ||
"./SearchCore": "<rootDir>/tests/__fixtures__/core/SearchCore.ts" | ||
}, | ||
resetMocks: true, | ||
restoreMocks: true, | ||
transform: { | ||
"\\.[jt]sx?$": [ | ||
"ts-jest", | ||
{ | ||
tsconfig: { | ||
allowSyntheticDefaultImports: true, | ||
esModuleInterop: true, | ||
allowJs: true, | ||
target: "ESNext", | ||
jsx: "react-jsx" | ||
}, | ||
diagnostics: { | ||
ignoreCodes: [ | ||
1343 | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}; | ||
|
||
export default config; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.