Skip to content

Commit

Permalink
Adding cases to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit3200 committed Dec 3, 2024
1 parent 4c6c767 commit cce1e0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,16 @@ describe('percyScreenshot', () => {

it('throw error in SDK if PERCY_RAISE_ERROR is true', async () => {
process.env.PERCY_RAISE_ERROR = 'true';
await helpers.test('error', '/percy/automateScreenshot');
spyOn(percySnapshot, 'isPercyEnabled').and.callThrough();
await helpers.test('error', '/percy/healthcheck');
let error = null;
try {
await percyScreenshot(driver, 'Snapshot 1');
} catch (e) {
error = e;
}

expect(helpers.logger.stderr).toEqual(jasmine.arrayContaining([
'[percy] Could not take Screenshot "Snapshot 1"'
expect(helpers.logger.stdout).toEqual(jasmine.arrayContaining([
'[percy] Percy is not running, disabling snapshots'
]));
expect(error).toBeInstanceOf(Error);
});
Expand Down

0 comments on commit cce1e0b

Please sign in to comment.