([returnValue, filePath]: [
TransformedSource,
string,
])
| 474 | ]; |
| 475 | |
| 476 | const buildPromise = async ([returnValue, filePath]: [ |
| 477 | TransformedSource, |
| 478 | string, |
| 479 | ]): Promise<any> => { |
| 480 | const processorName = `passthrough-preprocessor${filePath.replaceAll( |
| 481 | /\.|\//g, |
| 482 | '-', |
| 483 | )}`; |
| 484 | |
| 485 | jest.doMock( |
| 486 | processorName, |
| 487 | () => ({ |
| 488 | processAsync: jest.fn(), |
| 489 | }), |
| 490 | {virtual: true}, |
| 491 | ); |
| 492 | const transformer = require(processorName) as AsyncTransformer; |
| 493 | jest.mocked(transformer.processAsync).mockResolvedValue(returnValue); |
| 494 | |
| 495 | config = { |
| 496 | ...config, |
| 497 | transform: [...incorrectReturnValues, ...correctReturnValues].map( |
| 498 | ([_, filePath]) => [filePath, processorName, {}], |
| 499 | ), |
| 500 | }; |
| 501 | |
| 502 | const scriptTransformer = await createScriptTransformer(config); |
| 503 | |
| 504 | return scriptTransformer.transformAsync(filePath, getCoverageOptions()); |
| 505 | }; |
| 506 | |
| 507 | const promisesToReject = incorrectReturnValues |
| 508 | .map(buildPromise) |
nothing calls this directly
no test coverage detected