Browse Source
using svelte format for stories requires storybook to run with the --index-json flag but this breaks the storage location of DOM snapshots the configuration files in this commit fixes this and also moves them to the same location as the image snapshotsmaster
4 changed files with 26 additions and 3 deletions
@ -0,0 +1,13 @@ |
|||||||
|
const { getJestConfig } = require('@storybook/test-runner'); |
||||||
|
const path = require('path'); |
||||||
|
/** |
||||||
|
* @type {import('@jest/types').Config.InitialOptions} |
||||||
|
*/ |
||||||
|
module.exports = { |
||||||
|
// The default configuration comes from @storybook/test-runner
|
||||||
|
...getJestConfig(), |
||||||
|
/** Add your own overrides below |
||||||
|
* @see https://jestjs.io/docs/configuration
|
||||||
|
*/ |
||||||
|
snapshotResolver: "<rootDir>/test-runner-snapshotresolver.js" |
||||||
|
}; |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
const path = require('path'); |
||||||
|
|
||||||
|
module.exports = { |
||||||
|
resolveSnapshotPath: (testPath, snapshotExtension) => |
||||||
|
path.join(process.cwd(), '__snapshots__', path.basename(testPath) + snapshotExtension), |
||||||
|
resolveTestPath: (snapshotFilePath, snapshotExtension) => |
||||||
|
path.join(process.env.TEST_ROOT, path.basename(snapshotFilePath, snapshotExtension)), |
||||||
|
testPathForConsistencyCheck: path.join(process.env.TEST_ROOT, 'example.test.js'), |
||||||
|
}; |
||||||
Loading…
Reference in new issue