(variant: TestVariants)
| 1505 | // test snapshot when run against turbo. This fn returns describe, or describe.skip dependes on the running context |
| 1506 | // to avoid force-snapshot update per each runs until turbopack update includes all the changes. |
| 1507 | export function getSnapshotTestDescribe(variant: TestVariants) { |
| 1508 | const runningEnv = variant ?? 'default' |
| 1509 | if (runningEnv !== 'default' && runningEnv !== 'turbo') { |
| 1510 | throw new Error( |
| 1511 | `An invalid test env was passed: ${variant} (only "default" and "turbo" are valid options)` |
| 1512 | ) |
| 1513 | } |
| 1514 | |
| 1515 | const shouldRunTurboDev = shouldUseTurbopack() |
| 1516 | const shouldSkip = |
| 1517 | (runningEnv === 'turbo' && !shouldRunTurboDev) || |
| 1518 | (runningEnv === 'default' && shouldRunTurboDev) |
| 1519 | |
| 1520 | return shouldSkip ? describe.skip : describe |
| 1521 | } |
| 1522 | |
| 1523 | const nextjsClientComponentNames = [ |
| 1524 | // Pages Router |
nothing calls this directly
no test coverage detected