Skip to content

Commit

Permalink
🔥 Remove unnecessary code (#143)
Browse files Browse the repository at this point in the history
✅ Properly capture og browser reference
  • Loading branch information
Wil Wilsman committed Nov 12, 2020
1 parent a4600e0 commit 5c728d1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 67 deletions.
5 changes: 0 additions & 5 deletions lib/environment.ts

This file was deleted.

45 changes: 0 additions & 45 deletions lib/index.ts

This file was deleted.

19 changes: 2 additions & 17 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const sdk = require('@percy/sdk-utils/test/helper');
const percySnapshot = require('..');

describe('percySnapshot', () => {
let og = browser;
let og;

before(async () => {
await sdk.testsite.mock();
Expand All @@ -15,6 +15,7 @@ describe('percySnapshot', () => {
});

beforeEach(async function() {
og = browser;
this.timeout(0);
await sdk.setup();
await browser.get('http://localhost:8000');
Expand Down Expand Up @@ -92,20 +93,4 @@ describe('percySnapshot', () => {
'[percy] Error: failure\n'
]);
});

it('handles eval errors', async () => {
sdk.serializeDOM = () => {
throw new Error('serialize error');
};

await sdk.stdio(async () => {
await percySnapshot('Snapshot 1');
});

expect(sdk.stdio[1]).toHaveLength(0);
expect(sdk.stdio[2]).toEqual([
'[percy] Could not take DOM snapshot "Snapshot 1"\n',
'[percy] JavascriptError: Error: serialize error\n'
]);
});
});

0 comments on commit 5c728d1

Please sign in to comment.