chore: fix leftover eslint exceptions

This commit is contained in:
iCrawl
2022-09-01 21:26:09 +02:00
parent edadb9fe5d
commit 3b7ba4062e
80 changed files with 141 additions and 337 deletions

View File

@@ -20,7 +20,6 @@ function createTestCollection(): TestCollection {
function expectInvalidFunctionError(cb: () => unknown, val?: unknown): void {
expect(() => {
cb();
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
}).toThrowError(new TypeError(`${val} is not a function`));
}
@@ -133,9 +132,9 @@ describe('each() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.each());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.each(123), 123);
});
@@ -154,7 +153,7 @@ describe('each() tests', () => {
describe('ensure() tests', () => {
test('throws if defaultValueGenerator is not a function', () => {
const coll = createTestCollection();
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.ensure('d', 'abc'), 'abc');
});
@@ -178,7 +177,7 @@ describe('equals() tests', () => {
const coll2 = createTestCollection();
test('returns false if no collection is passed', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expect(coll1.equals()).toBeFalsy();
});
@@ -200,9 +199,9 @@ describe('every() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.every());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.every(123), 123);
});
@@ -226,9 +225,9 @@ describe('filter() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.filter());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.filter(123), 123);
});
@@ -253,9 +252,9 @@ describe('find() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => createCollection().find());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => createCollection().find(123), 123);
});
@@ -277,9 +276,9 @@ describe('findKey() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.findKey());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.findKey(123), 123);
});
@@ -508,9 +507,9 @@ describe('map() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.map());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.map(123), 123);
});
@@ -531,9 +530,9 @@ describe('mapValues() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.mapValues());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.mapValues(123), 123);
});
@@ -608,9 +607,9 @@ describe('partition() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.partition());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.partition(123), 123);
});
@@ -692,9 +691,9 @@ describe('reduce() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.reduce());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.reduce(123), 123);
});
@@ -731,9 +730,9 @@ describe('some() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.some());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.some(123), 123);
});
@@ -775,9 +774,9 @@ describe('sweep() test', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.sweep());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.sweep(123), 123);
});
@@ -802,9 +801,9 @@ describe('tap() tests', () => {
const coll = createTestCollection();
test('throws if fn is not a function', () => {
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.tap());
// @ts-expect-error: invalid function
// @ts-expect-error: Invalid function
expectInvalidFunctionError(() => coll.tap(123), 123);
});