( filter: TestFilter | null, )
| 175 | } |
| 176 | |
| 177 | export async function getFixtures( |
| 178 | filter: TestFilter | null, |
| 179 | ): Promise<Map<string, TestFixture>> { |
| 180 | const inputs = await readInputFixtures(FIXTURES_PATH, filter); |
| 181 | const outputs = await readOutputFixtures(FIXTURES_PATH, filter); |
| 182 | |
| 183 | const fixtures: Map<string, TestFixture> = new Map(); |
| 184 | for (const [partialPath, {value, filepath}] of inputs) { |
| 185 | const output = outputs.get(partialPath) ?? null; |
| 186 | fixtures.set(partialPath, { |
| 187 | fixturePath: partialPath, |
| 188 | input: value, |
| 189 | inputPath: filepath, |
| 190 | snapshot: output, |
| 191 | snapshotPath: path.join(FIXTURES_PATH, partialPath) + SNAPSHOT_EXTENSION, |
| 192 | }); |
| 193 | } |
| 194 | |
| 195 | for (const [partialPath, output] of outputs) { |
| 196 | if (!fixtures.has(partialPath)) { |
| 197 | fixtures.set(partialPath, { |
| 198 | fixturePath: partialPath, |
| 199 | input: null, |
| 200 | inputPath: 'none', |
| 201 | snapshot: output, |
| 202 | snapshotPath: |
| 203 | path.join(FIXTURES_PATH, partialPath) + SNAPSHOT_EXTENSION, |
| 204 | }); |
| 205 | } |
| 206 | } |
| 207 | return fixtures; |
| 208 | } |
no test coverage detected