diff --git a/test/index.test.ts b/test/index.test.ts index e6e36b1..228d6e3 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -6,7 +6,8 @@ import { PickKeys, FetchKeys, postprocessQuery, - Api + Api, + PaginatedPublicArticleList } from './generated/__generated-api' import onCreateRoute from '../src/onCreateRoute' @@ -387,4 +388,14 @@ describe('API class', () => { }[] }>() }) + + it('infers array fetchKeys parameter type as const', () => { + const testFn = >( + fetchKeys: T + ) => fetchKeys + + const returnedFetchKeys = testFn(['author']) + // check if array fetchKeys are inferred as ["key"], not "key"[] when passed into a function + expectTypeOf(returnedFetchKeys).toEqualTypeOf<['author']>() + }) })