Skip to content

Commit

Permalink
make emptify arg required
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Aug 27, 2020
1 parent 26dfa65 commit 389f912
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function emptifyMock<T>(
dataAccessLayer: DataAccessLayer;
metadata: Metadata<T>;
},
dataShouldBeEmpty?: EmptiableRequests[]
dataShouldBeEmpty: EmptiableRequests[]
): {
dataAccessLayer: DataAccessLayer;
metadata: Metadata<T>;
Expand All @@ -48,7 +48,7 @@ export function emptifyMock<T>(
* Fetch related events for an entity ID
*/
async relatedEvents(...args): Promise<ResolverRelatedEvents> {
return dataShouldBeEmpty?.includes('relatedEvents')
return dataShouldBeEmpty.includes('relatedEvents')
? Promise.resolve({
entityID: args[0],
events: [],
Expand All @@ -61,7 +61,7 @@ export function emptifyMock<T>(
* Fetch a ResolverTree for a entityID
*/
async resolverTree(...args): Promise<ResolverTree> {
return dataShouldBeEmpty?.includes('resolverTree')
return dataShouldBeEmpty.includes('resolverTree')
? Promise.resolve(mockTreeWithNoProcessEvents())
: dataAccessLayer.resolverTree(...args);
},
Expand All @@ -70,7 +70,7 @@ export function emptifyMock<T>(
* Get an array of index patterns that contain events.
*/
indexPatterns(...args): string[] {
return dataShouldBeEmpty?.includes('indexPatterns')
return dataShouldBeEmpty.includes('indexPatterns')
? []
: dataAccessLayer.indexPatterns(...args);
},
Expand All @@ -79,7 +79,7 @@ export function emptifyMock<T>(
* Get entities matching a document.
*/
async entities(...args): Promise<ResolverEntityIndex> {
return dataShouldBeEmpty?.includes('entities')
return dataShouldBeEmpty.includes('entities')
? Promise.resolve([])
: dataAccessLayer.entities(...args);
},
Expand Down

0 comments on commit 389f912

Please sign in to comment.