Skip to content

Commit d679f64

Browse files
committed
fix(cypress): reduce logging in beforeEach and remove unnecessary log tasks
1 parent a005532 commit d679f64

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

cypress/e2e/common/spec_utils.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,25 @@ export function beforeEach(taskResult, backend) {
1717
const spec = Cypress.mocha.getRunner().suite.ctx.currentTest.parent.title;
1818
const testName = Cypress.mocha.getRunner().suite.ctx.currentTest.title;
1919

20-
cy.task('log', `[beforeEach] backend=${backend} spec="${spec}" test="${testName}"`);
21-
cy.task('log', `[beforeEach] mockResponses=${String(taskResult.data.mockResponses)}`);
22-
2320
cy.task('setupBackendTest', {
2421
backend,
2522
...taskResult.data,
2623
spec,
2724
testName,
28-
}).then(() => {
29-
cy.task('log', '[beforeEach] setupBackendTest completed');
3025
});
3126

3227
if (taskResult.data.mockResponses) {
3328
const fixture = `${spec}__${testName}.json`;
34-
cy.task('log', `[beforeEach] Loading fixture: "${fixture}"`);
35-
cy.stubFetch({ fixture }).then(() => {
36-
cy.task('log', '[beforeEach] stubFetch completed');
37-
});
38-
} else {
39-
cy.task('log', '[beforeEach] Skipping fixture load - mockResponses is false/undefined');
29+
console.log('loading fixture:', fixture);
30+
cy.stubFetch({ fixture });
4031
}
4132

4233
// cy.clock(0, ['Date']) was hanging git-gateway tests after page load
4334
// Hypothesis: freezing time to 0 breaks app initialization during cy.visit()
4435
// Temporary fix: skip cy.clock for git-gateway, use default clock for others
4536
if (backend !== 'git-gateway') {
46-
cy.task('log', '[beforeEach] Setting clock to epoch 0 for non-git-gateway');
4737
return cy.clock(0, ['Date']);
4838
}
49-
50-
cy.task('log', '[beforeEach] Skipped clock for git-gateway');
5139
}
5240

5341
export function afterEach(taskResult, backend) {

cypress/plugins/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ const { copyBackendFiles, switchVersion, updateConfig } = require('../utils/conf
4141
module.exports = async (on, config) => {
4242
// `on` is used to hook into various events Cypress emits
4343
on('task', {
44-
log(message) {
45-
console.log(message);
46-
return null;
47-
},
4844
async setupBackend({ backend, options }) {
4945
console.log('Preparing environment for backend', backend);
5046
await copyBackendFiles(backend);

0 commit comments

Comments
 (0)