diff --git a/tests/_selftest.ts b/tests/_selftest.ts index 7a242a8..1608fb0 100644 --- a/tests/_selftest.ts +++ b/tests/_selftest.ts @@ -1,5 +1,4 @@ import path from 'node:path' -import fs from 'node:fs' import { runInRepo } from '../utils' import { RunOptions } from '../types' @@ -7,24 +6,23 @@ export async function test(options: RunOptions) { await runInRepo({ ...options, repo: 'vuejs/ecosystem-ci', - build: async () => { - const dir = path.resolve(options.workspace, 'ecosystem-ci') - const pkgFile = path.join(dir, 'package.json') - const pkg = JSON.parse(await fs.promises.readFile(pkgFile, 'utf-8')) - if (pkg.name !== '@vue/ecosystem-ci') { - throw new Error( - `invalid checkout, expected package.json with "name": "@vue/ecosystem-ci" in ${dir}`, - ) - } - pkg.scripts.selftestscript = - "[ -d ../../core/packages/vue/dist ] || (echo 'vue build failed' && exit 1)" - await fs.promises.writeFile( - pkgFile, - JSON.stringify(pkg, null, 2), - 'utf-8', - ) - }, test: 'pnpm run selftestscript', verify: false, + patchFiles: { + 'package.json': (content) => { + const pkg = JSON.parse(content) + if (pkg.name !== '@vue/ecosystem-ci') { + throw new Error( + `invalid checkout, expected package.json with "name": "@vue/ecosystem-ci" in ${path.resolve( + options.workspace, + 'ecosystem-ci', + )}`, + ) + } + pkg.scripts.selftestscript = + "[ -d ../../core/packages/vue/dist ] || (echo 'vue build failed' && exit 1)" + return JSON.stringify(pkg, null, 2) + }, + }, }) } diff --git a/tests/quasar.ts b/tests/quasar.ts index f9b4671..6bdee91 100644 --- a/tests/quasar.ts +++ b/tests/quasar.ts @@ -1,5 +1,3 @@ -import fs from 'node:fs' -import path from 'node:path' import { runInRepo } from '../utils' import { RunOptions } from '../types' @@ -9,26 +7,17 @@ export async function test(options: RunOptions) { repo: 'quasarframework/quasar', branch: 'dev', build: 'vue-ecosystem-ci:build', + test: 'vue-ecosystem-ci:test', // Need to skip QSelect tests until https://github.com/quasarframework/quasar-testing/issues/343 is resolved - beforeTest: async () => { - const dir = path.resolve(options.workspace, 'quasar') - const cypressConfigPath = path.resolve(dir, 'ui/dev/cypress.config.cjs') - const cypressConfigFile = await fs.promises.readFile( - cypressConfigPath, - 'utf-8', - ) - await fs.promises.writeFile( - cypressConfigPath, - cypressConfigFile + - ` -module.exports.component.excludeSpecPattern = [ - '../src/components/**/QSelect.cy.js', - '../src/composables/**/use-validate.cy.js' -] -`, - 'utf-8', - ) + patchFiles: { + 'ui/dev/cypress.config.cjs': (content) => + content + + ` + module.exports.component.excludeSpecPattern = [ + '../src/components/**/QSelect.cy.js', + '../src/composables/**/use-validate.cy.js' + ] + `, }, - test: 'vue-ecosystem-ci:test', }) }