Skip to content

Commit

Permalink
Change methodMissing to _methodMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Bogart committed Jan 27, 2021
1 parent 8841fa0 commit 7fb980b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/definition-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DefinitionProxy<T> {
return this.definition.sequenceHandler;
}

methodMissing(name: string, ...rest: any[]): void {
_methodMissing(name: string, ...rest: any[]): void {
this.attr(name, ...rest);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Evaluator {
}
}

async methodMissing(name: string): Promise<any> {
async _methodMissing(name: string): Promise<any> {
return this.attr(name);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/method-missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
export function addMethodMissing(definitionProxy: any): any {
const handler = {
get(target: any, prop: string, receiver: any) {
if (Reflect.has(target, prop) || prop === "methodMissing") {
if (Reflect.has(target, prop) || prop === "_methodMissing") {
return Reflect.get(target, prop, receiver);
}
return function(...args: any[]) {
return Reflect.get(target, "methodMissing").call(target, prop, ...args);
return Reflect.get(target, "_methodMissing").call(target, prop, ...args);
};
},
};
Expand Down
4 changes: 2 additions & 2 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ConvertToFn<T, ArgFN = () => any> = {

type CurrentEvaluator<T> = {
[Key in keyof T]-?: () => Promise<T[Key]>;
} & Exclude<Evaluator, "methodMissing">;
} & Exclude<Evaluator, "_methodMissing">;

export type EvaluatorFunction<T> =
| ((evaluator: CurrentEvaluator<T>) => any)
Expand All @@ -42,7 +42,7 @@ export type EvaluatorFunction<T> =

type FixtureBuilder<T> = (
& ConvertToFn<T, EvaluatorFunction<T>>
& Exclude<DefinitionProxy<T>, "methodMissing">
& Exclude<DefinitionProxy<T>, "_methodMissing">
);

export type BlockFunction<T> = (fixture: FixtureBuilder<T>) => any;
Expand Down

0 comments on commit 7fb980b

Please sign in to comment.