mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-25 07:22:43 +00:00
Migrate cypress to v16
This commit is contained in:
1 parent
1c76fb76ea
commit
ec0f30106d
5 files changed
+38
-9
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { plugin as cypressGrepPlugin } from "@cypress/grep/plugin";
|
||||
import { SwaggerValidation } from "@jc21/cypress-swagger-validation";
|
||||
import { exec } from "node:child_process";
|
||||
import chalk from "chalk";
|
||||
import backendTask from "./backendApi/task.mjs";
|
||||
|
||||
@@ -25,6 +26,32 @@ export default (on, config) => {
|
||||
return null;
|
||||
},
|
||||
});
|
||||
on("task", {
|
||||
/**
|
||||
* Replacement for cy.exec(), removed in Cypress 16
|
||||
*
|
||||
* @param {object} options
|
||||
* @param {string} options.command
|
||||
* @param {bool} [options.failOnNonZeroExit] Defaults to true
|
||||
* @returns {object} { exitCode, stdout, stderr }
|
||||
*/
|
||||
exec({ command, failOnNonZeroExit = true }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(command, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
|
||||
const result = {
|
||||
exitCode: error ? (error.code ?? 1) : 0,
|
||||
stdout: stdout.trimEnd(),
|
||||
stderr: stderr.trimEnd(),
|
||||
};
|
||||
if (error && failOnNonZeroExit) {
|
||||
reject(new Error(`Command failed with exit code ${result.exitCode}: ${command}\n${result.stderr}`));
|
||||
return;
|
||||
}
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
on("task", {
|
||||
getFixturesFolder() {
|
||||
return config.fixturesFolder;
|
||||
|
||||
Reference in new issue
Block a user