Skip to content
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
3 changes: 1 addition & 2 deletions src/browser/commands/assert-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const { getCaptureProcessors } = require("./capture-processors");
const RuntimeConfig = require("../../../config/runtime-config");
const AssertViewResults = require("./assert-view-results");
const { BaseStateError } = require("./errors/base-state-error");
const { AssertViewError } = require("./errors/assert-view-error");

const getIgnoreDiffPixelCountRatio = value => {
const percent = _.isString(value) && value.endsWith("%") ? parseFloat(value.slice(0, -1)) : false;
Expand Down Expand Up @@ -55,7 +54,7 @@ module.exports.default = browser => {
testplaneCtx.assertViewResults = testplaneCtx.assertViewResults || AssertViewResults.create();

if (testplaneCtx.assertViewResults.hasState(state)) {
return Promise.reject(new AssertViewError(`duplicate name for "${state}" state`));
return Promise.reject(new Error(`duplicate name for "${state}" state`));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"AssertViewError" is not shown in html-reporter

}

const handleCaptureProcessorError = e =>
Expand Down
5 changes: 2 additions & 3 deletions test/src/browser/commands/assert-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const { Image } = require("src/image");
const ScreenShooter = require("src/browser/screen-shooter");
const temp = require("src/temp");
const validator = require("png-validator");
const { AssertViewError } = require("src/browser/commands/assert-view/errors/assert-view-error");
const { ImageDiffError } = require("src/browser/commands/assert-view/errors/image-diff-error");
const { NoRefImageError } = require("src/browser/commands/assert-view/errors/no-ref-image-error");
const RuntimeConfig = require("src/config/runtime-config");
Expand Down Expand Up @@ -149,7 +148,7 @@ describe("assertView command", () => {
const elem = await browser.publicAPI.$(".selector");
await elem.assertView("plain");
} catch (e) {
assert.instanceOf(e, AssertViewError);
assert.instanceOf(e, Error);
assert.equal(e.message, 'duplicate name for "plain" state');
}
});
Expand Down Expand Up @@ -210,7 +209,7 @@ describe("assertView command", () => {
const elem = await browser.publicAPI.$(".selector");
await elem.assertView("plain");
} catch (e) {
assert.instanceOf(e, AssertViewError);
assert.instanceOf(e, Error);
assert.equal(e.message, 'duplicate name for "plain" state');
}
});
Expand Down
Loading