diff --git a/jest.config.base.js b/jest.config.base.js index f5e93a5439de7..5b1f1d88592aa 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -18,6 +18,8 @@ const config = { '/node_modules/(?!abortable-rx|@sourcegraph/react-loading-spinner|@sourcegraph/codeintellify)', ], + moduleNameMapper: { '\\.s?css$': 'identity-obj-proxy' }, + // By default, don't clutter `yarn test --watch` output with the full coverage table. To see it, use the // `--coverageReporters text` jest option. coverageReporters: ['json', 'lcov', 'text-summary'], diff --git a/package.json b/package.json index 58f6340056b3a..1b2b30c36d6ad 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "graphql": "^14.0.2", "graphql-schema-linter": "^0.1.6", "gulp": "^4.0.0", + "identity-obj-proxy": "^3.0.0", "jest": "^23.6.0", "json-schema-ref-parser": "^6.0.2", "json-schema-to-typescript": "^6.1.0", diff --git a/shared/.storybook/config.js b/shared/.storybook/config.js index 665606fd29fef..f5428d89964ac 100644 --- a/shared/.storybook/config.js +++ b/shared/.storybook/config.js @@ -3,15 +3,18 @@ import { configure, addDecorator } from '@storybook/react' import { withInfo } from '@storybook/addon-info' import { withOptions } from '@storybook/addon-options' +// @ts-ignore import { themes } from '@storybook/components' import { configureActions } from '@storybook/addon-actions' import '@storybook/addon-console' +// @ts-ignore import { withConsole } from '@storybook/addon-console' import { withNotes } from '@storybook/addon-notes' import '../../web/src/SourcegraphWebApp.scss' addDecorator(withNotes()) addDecorator((storyFn, context) => withConsole()(storyFn)(context)) +// @ts-ignore addDecorator(withOptions({ theme: themes.dark })) addDecorator(withInfo({ header: false, propTables: false })) diff --git a/shared/src/storybook.test.ts b/shared/src/storybook.test.ts index e66f14165b6f2..e9db0987a69fd 100644 --- a/shared/src/storybook.test.ts +++ b/shared/src/storybook.test.ts @@ -1,3 +1,4 @@ import initStoryshots from '@storybook/addon-storyshots' +import path from 'path' -initStoryshots({ configPath: '../.storybook' }) +initStoryshots({ framework: 'react', configPath: path.resolve(__dirname, '../.storybook/config.js') }) diff --git a/yarn.lock b/yarn.lock index f9377da337cd1..90bf59ee03ad4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7755,6 +7755,11 @@ har-validator@~5.1.0: ajv "^6.5.5" har-schema "^2.0.0" +harmony-reflect@^1.4.6: + version "1.6.1" + resolved "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9" + integrity sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA== + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -8133,6 +8138,13 @@ icss-utils@^4.0.0: dependencies: postcss "^7.0.5" +identity-obj-proxy@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" + integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ= + dependencies: + harmony-reflect "^1.4.6" + ieee754@^1.1.4: version "1.1.12" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"