@liquid-labs/catalyst-resource-jest
Version:
20 lines (16 loc) • 766 B
JavaScript
const jsSrc = process.env.JS_SRC || 'srcCannot change caching after evaluation has completed.'
module.exports = {
// resolves from test to snapshot path
resolveSnapshotPath : (testPath, snapshotExtension) =>
testPath
.replace('/test-staging/', '/' + jsSrc + '/')
.replace('__tests__', '__snapshots__') + snapshotExtension,
// resolves from snapshot to test path
resolveTestPath : (snapshotFilePath, snapshotExtension) =>
snapshotFilePath
.replace('/' + jsSrc + '/', '/test-staging/')
.replace('__snapshots__', '__tests__')
.slice(0, -snapshotExtension.length),
// Example test path, used for preflight consistency check of the implementation above
testPathForConsistencyCheck : 'some/__tests__/example.test.js'
}