mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 03:40:14 +00:00
28 lines
704 B
TypeScript
28 lines
704 B
TypeScript
import { defineConfig } from "cypress";
|
|
|
|
export default defineConfig({
|
|
e2e: {
|
|
setupNodeEvents: (on, config) => {
|
|
const isDev = config.watchForFileChanges;
|
|
const port = process.env.PORT ?? (isDev ? "3000" : "8811");
|
|
const configOverrides: Partial<Cypress.PluginConfigOptions> = {
|
|
baseUrl: `http://localhost:${port}`,
|
|
video: !process.env.CI,
|
|
screenshotOnRunFailure: !process.env.CI,
|
|
};
|
|
|
|
// To use this:
|
|
// cy.task('log', whateverYouWantInTheTerminal)
|
|
on("task", {
|
|
log: (message) => {
|
|
console.log(message);
|
|
|
|
return null;
|
|
},
|
|
});
|
|
|
|
return { ...config, ...configOverrides };
|
|
},
|
|
},
|
|
});
|