Skip to content

Commit

Permalink
Remove unnecessary closure
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Jun 24, 2023
1 parent f62aa1a commit 715c04e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/browser/vdiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { executeServerCommand } from '@web/test-runner-commands';
mocha.setup({ // eslint-disable-line no-undef
rootHooks: {
beforeEach() {
chai.Assertion.addMethod('golden',
(test => function(...args) {
return ScreenshotAndCompare.call(test, this._obj, ...args); // eslint-disable-line no-invalid-this
})(this.currentTest));
const { currentTest } = this;
chai.Assertion.addMethod('golden', function(...args) {
return ScreenshotAndCompare(currentTest, this._obj, ...args); // eslint-disable-line no-invalid-this
});
}
}
});

async function ScreenshotAndCompare(elem, opts) {
const name = this.fullTitle();
async function ScreenshotAndCompare(test, elem, opts) {
const name = test.fullTitle();
const rect = elem.getBoundingClientRect();
const { pass, message } = await executeServerCommand('brightspace-visual-diff', { name, rect, opts });
if (!pass) {
Expand Down

0 comments on commit 715c04e

Please sign in to comment.