Skip to content

Commit 9e5474e

Browse files
committed
add tests for async hooks
1 parent e38103a commit 9e5474e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

types/tests.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const fgraphqlOptions2: FGraphQLHookOptions = {
260260
Query: {}
261261
},
262262
options: {
263-
extraAuthProps: ['asdf' ],
263+
extraAuthProps: ['asdf'],
264264
inclAllFields: false,
265265
inclJoinedNames: false,
266266
inclAllFieldsClient: true,
@@ -306,7 +306,7 @@ makeCallingParams(
306306
// tslint:disable-next-line
307307
class ObjId {
308308
// tslint:disable-next-line
309-
constructor(id?: string | number) {}
309+
constructor(id?: string | number) { }
310310
}
311311

312312
// $ExpectType Hook
@@ -388,17 +388,17 @@ setNow('createdAt', 'updatedAt');
388388
setSlug('storeId');
389389

390390
// $ExpectType Hook
391-
sequelizeConvert ({
391+
sequelizeConvert({
392392
aBool: 'boolean',
393393
aDate: 'date',
394394
anObject: 'json',
395395
aNumber: 'strToInt'
396396
}, null, {
397-
strToInt: {
398-
js: (sqlValue: string) => +sqlValue,
399-
sql: (jsValue: number) => `${jsValue}`,
400-
}
401-
});
397+
strToInt: {
398+
js: (sqlValue: string) => +sqlValue,
399+
sql: (jsValue: number) => `${jsValue}`,
400+
}
401+
});
402402

403403
// $ExpectType Hook
404404
sifter(ctx => item => true);
@@ -449,11 +449,17 @@ validateSchema({}, ajv);
449449

450450
// $ExpectType Hook
451451
iffElse(syncTrue, [hook1, hook2], [hook3, hook4]);
452+
// $ExpectType Hook
453+
iffElse(asyncTrue, [hook1, hook2], [hook3, hook4]);
452454

453455
// $ExpectType IffHook
454456
iff(syncTrue, hook1, hook2);
457+
// $ExpectType IffHook
458+
iff(asyncTrue, hook1, hook2);
455459
// $ExpectType Hook
456460
iff(syncTrue, hook1, hook2).else(hook3, hook4);
461+
// $ExpectType Hook
462+
iff(asyncTrue, hook1, hook2).else(hook3, hook4);
457463

458464
// $ExpectType IffHook
459465
when(syncTrue, hook1, hook2);

0 commit comments

Comments
 (0)