Skip to content

Commit e14aa0a

Browse files
committed
🎀 lint
1 parent 8225c6b commit e14aa0a

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function formatWithLabel(label, value) {
2727
return formatDescriptorWithLabel(label, concordance.describe(value, concordanceOptions));
2828
}
2929

30-
const hasOwnProperty = (object, prop) => Object.prototype.hasOwnProperty.call(object, prop);
30+
export const hasOwnProperty = (object, prop) => Object.prototype.hasOwnProperty.call(object, prop);
3131
const noop = () => {};
3232
const notImplemented = () => {
3333
throw new Error('not implemented');

lib/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import concordance from 'concordance';
22
import isPromise from 'is-promise';
33
import plur from 'plur';
44

5-
import {AssertionError, Assertions, checkAssertionMessage} from './assert.js';
5+
import {AssertionError, Assertions, checkAssertionMessage, hasOwnProperty} from './assert.js';
66
import concordanceOptions from './concordance-options.js';
77
import nowAndTimers from './now-and-timers.cjs';
88
import parseTestArgs from './parse-test-args.js';
@@ -14,7 +14,7 @@ function isExternalAssertError(error) {
1414
}
1515

1616
// Match errors thrown by <https://www.npmjs.com/package/chai> and <https://nodejs.org/api/assert.html>.
17-
return error.hasOwnProperty('actual') && error.hasOwnProperty('expected');
17+
return hasOwnProperty(error, 'actual') && hasOwnProperty(error, 'expected');
1818
}
1919

2020
function formatErrorValue(label, error) {
@@ -533,13 +533,13 @@ export default class Test {
533533
this.saveFirstError(new AssertionError({
534534
message: 'Assertion failed',
535535
savedError: result.error instanceof Error && result.error,
536-
values: [{label: 'Assertion failed: ', formatted: result.error.message}]
536+
values: [{label: 'Assertion failed: ', formatted: result.error.message}],
537537
}));
538538
} else {
539539
this.saveFirstError(new AssertionError({
540540
message: 'Error thrown in test',
541541
savedError: result.error instanceof Error && result.error,
542-
values: [formatErrorValue('Error thrown in test:', result.error)]
542+
values: [formatErrorValue('Error thrown in test:', result.error)],
543543
}));
544544
}
545545

@@ -586,13 +586,13 @@ export default class Test {
586586
this.saveFirstError(new AssertionError({
587587
message: 'Assertion failed',
588588
savedError: error instanceof Error && error,
589-
values: [{label: 'Assertion failed: ', formatted: error.message}]
589+
values: [{label: 'Assertion failed: ', formatted: error.message}],
590590
}));
591591
} else {
592592
this.saveFirstError(new AssertionError({
593593
message: 'Rejected promise returned by test',
594594
savedError: error instanceof Error && error,
595-
values: [formatErrorValue('Rejected promise returned by test. Reason:', error)]
595+
values: [formatErrorValue('Rejected promise returned by test. Reason:', error)],
596596
}));
597597
}
598598
})

test/external-assertions/fixtures/expect-failure.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { expect } from 'expect';
2-
31
import test from 'ava';
2+
import {expect} from 'expect';
43

54
test('test', () => {
65
expect(false).toBeTruthy();

0 commit comments

Comments
 (0)