Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Remove unnecessary code #143

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
]);
});
});