| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | module.exports = function makeSnapshotResolver(useForget) { |
| 9 | const modeExtension = useForget ? '.with-forget' : '.no-forget'; |
| 10 | return { |
| 11 | resolveSnapshotPath: (testPath, snapshotExtension) => |
| 12 | testPath + modeExtension + snapshotExtension, |
| 13 | |
| 14 | resolveTestPath: (snapshotFilePath, snapshotExtension) => |
| 15 | snapshotFilePath.slice( |
| 16 | 0, |
| 17 | -modeExtension.length - snapshotExtension.length |
| 18 | ), |
| 19 | |
| 20 | testPathForConsistencyCheck: 'some/__tests__/example.test.js', |
| 21 | }; |
| 22 | }; |