chore: Update linting dependency

This commit is contained in:
Joachim Van Herwegen
2023-12-08 13:30:44 +01:00
parent 6c1c935260
commit 3a9b0d69f0
9 changed files with 1575 additions and 4141 deletions

View File

@@ -310,6 +310,7 @@ describe('An IdentityProviderFactory', (): void => {
expect(use).toHaveBeenCalledTimes(1);
const middleware = use.mock.calls[0][0];
// eslint-disable-next-line jest/unbound-method
const oldAccept = ctx.accepts;
const next = jest.fn();
await expect(middleware(ctx, next)).resolves.toBeUndefined();
@@ -325,6 +326,7 @@ describe('An IdentityProviderFactory', (): void => {
expect(use).toHaveBeenCalledTimes(1);
const middleware = use.mock.calls[0][0];
// eslint-disable-next-line jest/unbound-method
const oldAccept = ctx.accepts;
const next = jest.fn();
await expect(middleware(ctx, next)).resolves.toBeUndefined();

View File

@@ -22,8 +22,8 @@ describe('A ClusterManager', (): void => {
beforeAll((): void => {
Object.assign(mockCluster, {
fork: jest.fn().mockImplementation((): any => mockWorker),
on: jest.fn().mockImplementation(emitter.on),
emit: jest.fn().mockImplementation(emitter.emit),
on: jest.fn().mockImplementation(emitter.on.bind(emitter)),
emit: jest.fn().mockImplementation(emitter.emit.bind(emitter)),
isMaster: true,
isWorker: false,
});

View File

@@ -819,7 +819,7 @@ describe('A DataAccessorBasedStore', (): void => {
const auxResourceID = { path: `${root}resource.dummy` };
accessor.data[resourceID.path] = representation;
accessor.data[auxResourceID.path] = representation;
const deleteFn = accessor.deleteResource;
const deleteFn = accessor.deleteResource.bind(accessor);
jest.spyOn(accessor, 'deleteResource')
.mockImplementation(async(identifier: ResourceIdentifier): Promise<void> => {
if (auxiliaryStrategy.isAuxiliaryIdentifier(identifier)) {
@@ -862,6 +862,7 @@ describe('A DataAccessorBasedStore', (): void => {
it('should rethrow any unexpected errors from validateIdentifier.', async(): Promise<void> => {
const resourceID = { path: `${root}resource` };
// eslint-disable-next-line jest/unbound-method
const originalMetaData = accessor.getMetadata;
jest.spyOn(accessor, 'getMetadata').mockImplementation(async(): Promise<any> => {
throw new Error('error');

View File

@@ -33,7 +33,7 @@ describe('A LockingResourceStore', (): void => {
}
const readable = guardedStreamFrom([ 1, 2, 3 ]);
const { destroy } = readable;
const destroy = readable.destroy.bind(readable);
jest.spyOn(readable, 'destroy').mockImplementation((error): any => destroy.call(readable, error));
source = {
getRepresentation: jest.fn((): any => addOrder('getRepresentation', { data: readable } as Representation)),