MCPcopy
hub / github.com/prisma/prisma / testPackages

Function testPackages

scripts/ci/publish.ts:649–664  ·  view source on GitHub ↗

* Tests packages in "publishOrder" * @param packages Packages * @param publishOrder string[][]

(packages: Packages, publishOrder: string[][])

Source from the content-addressed store, hash-verified

647 * @param publishOrder string[][]
648 */
649async function testPackages(packages: Packages, publishOrder: string[][]): Promise<void> {
650 const order = flatten(publishOrder)
651
652 console.log(bold(`\nRun ${cyan('tests')}. Testing order:`))
653 console.log(order)
654
655 for (const pkgName of order) {
656 const pkg = packages[pkgName]
657 if (pkg.packageJson.scripts.test) {
658 console.log(`\nTesting ${magenta(pkg.name)}`)
659 await run(path.dirname(pkg.path), 'pnpm run test')
660 } else {
661 console.log(`\nSkipping ${magenta(pkg.name)}, as it doesn't have tests`)
662 }
663 }
664}
665
666function flatten<T>(arr: T[][]): T[] {
667 return arr.reduce((acc, val) => acc.concat(val), [])

Callers 1

publishFunction · 0.85

Calls 3

logMethod · 0.80
flattenFunction · 0.70
runFunction · 0.70

Tested by

no test coverage detected