Cypress module conversion and updated chalk

This commit is contained in:
Jamie Curnow
2026-01-27 08:45:23 +10:00
parent df06eb6c2f
commit 4af0a968f0
8 changed files with 62 additions and 52 deletions

View File

@@ -0,0 +1,21 @@
import { SwaggerValidation } from '@jc21/cypress-swagger-validation';
import chalk from 'chalk';
export default (on, config) => {
// Replace swaggerBase config var wildcard
if (typeof config.env.swaggerBase !== 'undefined') {
config.env.swaggerBase = config.env.swaggerBase.replace('{{baseUrl}}', config.baseUrl);
}
// Plugin Events
on('task', SwaggerValidation(config));
on('task', require('./backendApi/task')(config));
on('task', {
log(message) {
console.log(`${chalk.cyan.bold('[')}${chalk.blue.bold('LOG')}${chalk.cyan.bold(']')} ${chalk.red.bold(message)}`);
return null;
}
});
return config;
};