Add more compat tests

This commit is contained in:
Aria Minaei 2023-07-30 15:41:09 +02:00 committed by Aria
parent 29905d951f
commit dc2338bb83
32 changed files with 577 additions and 221 deletions

View file

@ -1,39 +0,0 @@
/**
* Build the test setups
*/
import path from 'path'
import {cd, fs, $} from 'zx'
import {getCompatibilityTestSetups} from './utils.mjs'
const absPathOfCompatibilityTestSetups = getCompatibilityTestSetups()
const setupsWithErros = []
// Try building the setups
;(async function () {
for (const setupDir of absPathOfCompatibilityTestSetups) {
try {
cd(setupDir)
const pathToSetup = path.join(setupDir, setupDir)
fs.removeSync(path.join(pathToSetup, 'node_modules'))
fs.removeSync(path.join(pathToSetup, 'package-lock.json'))
fs.removeSync(path.join(pathToSetup, 'yarn.lock'))
await $`npm install`
await $`npm run build`
} catch (err) {
console.error(err)
setupsWithErros.push(setupDir)
}
}
// Stop if there were any errors during the build process,
// and print all of them to the console.
if (setupsWithErros.length !== 0) {
throw new Error(
`The following setups had problems when their dependencies were being installed:\n${(
setupsWithErros.join('\n'),
)}`,
)
}
})()

View file

@ -78,7 +78,7 @@ export async function installFixtures() {
console.log('Running `$ npm install` on test packages')
await runNpmInstallOnTestPackages()
console.log('All tests installed successfully')
console.log('All fixtures installed successfully')
await verdaccioServer.close()
restoreTestPackageJsons()
console.log('Done')