mirror of
https://github.com/coder/coder.git
synced 2026-10-24 01:26:25 +08:00
This hooks up `storybook`, which the front-end team has enjoyed using in the v1 codebase - it makes it quick and easy to view and test components in isolation. The `<LoadingButton />` has a simple story added now, so if you run `yarn storybook`, you can preview it in various states:  This will be helpful as we bring more front-end devs to help build v2 out.
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
module.exports = {
|
|
projects: [
|
|
{
|
|
globals: {
|
|
"ts-jest": {
|
|
tsconfig: "tsconfig.test.json",
|
|
},
|
|
},
|
|
coverageReporters: ["text", "lcov"],
|
|
displayName: "test",
|
|
preset: "ts-jest",
|
|
roots: ["<rootDir>"],
|
|
setupFilesAfterEnv: ["<rootDir>/_jest/setupTests.ts"],
|
|
transform: {
|
|
"^.+\\.tsx?$": "ts-jest",
|
|
},
|
|
testEnvironment: "jsdom",
|
|
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
|
|
testPathIgnorePatterns: ["/node_modules/", "/__tests__/fakes"],
|
|
moduleDirectories: ["node_modules", "<rootDir>"],
|
|
},
|
|
{
|
|
displayName: "lint",
|
|
runner: "jest-runner-eslint",
|
|
testMatch: ["<rootDir>/**/*.js", "<rootDir>/**/*.ts", "<rootDir>/**/*.tsx"],
|
|
testPathIgnorePatterns: ["/.next/", "/out/", "/_jest/", "jest.config.js", "jest-runner.*.js", "next.config.js"],
|
|
},
|
|
],
|
|
collectCoverageFrom: [
|
|
"<rootDir>/**/*.js",
|
|
"<rootDir>/**/*.ts",
|
|
"<rootDir>/**/*.tsx",
|
|
"!<rootDir>/**/*.stories.tsx",
|
|
"!<rootDir>/_jest/**/*.*",
|
|
"!<rootDir>/.next/**/*.*",
|
|
"!<rootDir>/api.ts",
|
|
"!<rootDir>/coverage/**/*.*",
|
|
"!<rootDir>/dev.ts",
|
|
"!<rootDir>/jest-runner.eslint.config.js",
|
|
"!<rootDir>/jest.config.js",
|
|
"!<rootDir>/next-env.d.ts",
|
|
"!<rootDir>/next.config.js",
|
|
"!<rootDir>/out/**/*.*",
|
|
"!<rootDir>/storybook-static/**/*.*",
|
|
],
|
|
}
|