Skip to content

Commit

Permalink
chore: cypress flaky (#6956)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Mar 6, 2024
1 parent 12b2a00 commit cb0565e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions projects/demo-cypress/src/tests/static-request.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ describe('TuiStaticRequestService', () => {
let result2 = '';
let completed = false;

service.request(`${baseUrl}/test`).subscribe(response => {
result1 = response;
service.request(`${baseUrl}/test`).subscribe({
next: response => {
result1 = response;
},
complete: () => {
completed = true;
},
});

service.request(`${baseUrl}/test`).subscribe({
Expand All @@ -65,7 +70,8 @@ describe('TuiStaticRequestService', () => {
cy.get('@request.all')
.should('have.length', 1)
.then(() => {
expect(result1).to.equal(result2);
expect(JSON.stringify(response)).to.eql(result1);
expect(result1).to.eql(result2);
void expect(completed).to.be.true;
});
});
Expand Down

0 comments on commit cb0565e

Please sign in to comment.