-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1568 from lifeiscontent/chore/cleanup-storybook
- Loading branch information
Showing
12 changed files
with
20,055 additions
and
26,650 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
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 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,21 @@ | ||
import { MockedProvider } from '@apollo/client/testing'; | ||
import type { Preview } from '@storybook/react'; | ||
import { createCache } from '../src/lib/apolloClient'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
apolloClient: { | ||
MockedProvider, | ||
cache: createCache(), | ||
}, | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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 +1 @@ | ||
nodejs 16.14.0 | ||
nodejs 18.16.0 |
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,61 +1,15 @@ | ||
const esModules = [ | ||
'bail', | ||
'character-entities', | ||
'comma-separated-tokens', | ||
'decode-named-character-reference', | ||
'hast-util-whitespace', | ||
'is-plain-obj', | ||
'mdast-util-definitions', | ||
'mdast-util-from-markdown', | ||
'mdast-util-to-hast', | ||
'mdast-util-to-string', | ||
'micromark', | ||
'property-information', | ||
'react-markdown', | ||
'remark-parse', | ||
'remark-rehype', | ||
'space-separated-tokens', | ||
'trough', | ||
'unified', | ||
'unist-builder', | ||
'unist-util-generated', | ||
'unist-util-is', | ||
'unist-util-position', | ||
'unist-util-stringify-position', | ||
'unist-util-visit', | ||
'trim-lines', | ||
'vfile', | ||
].join('|'); | ||
const nextJest = require('next/jest'); | ||
|
||
module.exports = { | ||
collectCoverageFrom: [ | ||
'**/*.{js,jsx,ts,tsx}', | ||
'!**/*.d.ts', | ||
'!**/node_modules/**', | ||
], | ||
moduleNameMapper: { | ||
// Handle CSS imports (with CSS modules) | ||
// https://jestjs.io/docs/webpack#mocking-css-modules | ||
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy', | ||
const createJestConfig = nextJest({ | ||
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment | ||
dir: './', | ||
}); | ||
|
||
// Handle CSS imports (without CSS modules) | ||
'^.+\\.(css|sass|scss)$': '<rootDir>/__mocks__/styleMock.js', | ||
|
||
// Handle image imports | ||
// https://jestjs.io/docs/webpack#handling-static-assets | ||
'^.+\\.(jpg|jpeg|png|gif|webp|avif|svg)$': `<rootDir>/__mocks__/fileMock.js`, | ||
}, | ||
// Add any custom config to be passed to Jest | ||
const customJestConfig = { | ||
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'], | ||
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'], | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
// Use babel-jest to transpile tests with the next/babel preset | ||
// https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object | ||
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }], | ||
[`(${esModules}).+\\.js$`]: ['babel-jest', { presets: ['next/babel'] }], | ||
}, | ||
transformIgnorePatterns: [ | ||
`[/\\\\]node_modules[/\\\\](?!${esModules}).+\\.(js|jsx|mjs|cjs|ts|tsx)$`, | ||
'^.+\\.module\\.(css|sass|scss)$', | ||
], | ||
testEnvironment: 'jest-environment-jsdom', | ||
}; | ||
|
||
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async | ||
module.exports = createJestConfig(customJestConfig); |
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
Oops, something went wrong.