Skip to content

Commit

Permalink
fix(express): made handle() protected.
Browse files Browse the repository at this point in the history
  • Loading branch information
aahoogendoorn committed Mar 11, 2021
1 parent 7e6ea5f commit 52241ac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/express/ExpressProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ExpressProvider implements AppProvider {
this.app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
}

private static handle = (endpoint: Endpoint, options: VerbOptions): RequestHandler => (req: Request, res: Response, next: NextFunction) =>
protected static handle = (endpoint: Endpoint, options: VerbOptions): RequestHandler => (req: Request, res: Response, next: NextFunction) =>
endpoint(toReq(req))
.then((r: any) => toResponse(res, r, options))
.catch(error => next(toOriginatedError(error, options)));
Expand Down
2 changes: 1 addition & 1 deletion test/mongo/MongoProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('MongoProvider', () => {
provider.collection = mock.resolve(c);
const res = await provider.by('level', 1);
expect(res.last()).toMatchObject(devData.wouter);
expect(c.find).toHaveBeenCalledWith({ level: "1" }, { limit: 250 });
expect(c.find).toHaveBeenCalledWith({ level: '1' }, { limit: 250 });
});

test('add calls insertOne on the collection', async () => {
Expand Down
15 changes: 1 addition & 14 deletions test/types/Is.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import {
Entity,
isArray,
isBoolean,
isDefined,
isEmpty,
isEmptyObject,
isInstance,
isNotEmpty,
isNumber,
isObject,
isPrimitive,
isString,
} from '../../src';
import { Entity, isArray, isBoolean, isDefined, isEmpty, isEmptyObject, isInstance, isNotEmpty, isNumber, isObject, isPrimitive, isString } from '../../src';
import { Dev } from '../ref';

describe('isDefined', () => {
Expand Down
15 changes: 1 addition & 14 deletions test/validation/Validate.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import {
asList,
Entity,
Enum,
includes,
List,
required,
rule,
Struct,
toList,
valid,
validate,
Value,
} from '../../src';
import { asList, Entity, Enum, includes, List, required, rule, Struct, toList, valid, validate, Value } from '../../src';
import '@thisisagile/easy-test';
import { Dev } from '../ref';

Expand Down

0 comments on commit 52241ac

Please sign in to comment.