diff options
author | mat <github@matdoes.dev> | 2022-03-25 21:13:13 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-25 21:13:13 -0500 |
commit | 6b94d0110a52a355758432ff6cd14c80553471ea (patch) | |
tree | 8113e5ee126b56f2d7e31309b5fa1fd65d008a77 /test-data-generator/index.ts | |
parent | 7f4e9c598d4697e63602bc36f9034610cac84604 (diff) | |
download | skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.tar.gz skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.tar.bz2 skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.zip |
Add typed-hypixel-api as a dep and change some code
Diffstat (limited to 'test-data-generator/index.ts')
-rw-r--r-- | test-data-generator/index.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test-data-generator/index.ts b/test-data-generator/index.ts index 18cefd7..f296c16 100644 --- a/test-data-generator/index.ts +++ b/test-data-generator/index.ts @@ -4,6 +4,7 @@ globalThis.isTest = true +import typedHypixelApi from 'typed-hypixel-api' import * as hypixelApi from '../src/hypixelApi' import * as constants from '../src/constants' import * as mojang from '../src/mojang' @@ -24,11 +25,10 @@ async function writeTestData(requestPath: string, name: string, contents: any) { await fs.writeFile(path.join(dir, `${name}.json`), JSON.stringify(contents, null, 2)) } -async function addResponse(requestPath: string, args: { [ key: string ]: string }, name: string) { - const response = await hypixelApi.sendApiRequest({ - path: requestPath, - args: args, - key: hypixelApi.chooseApiKey() +async function addResponse(requestPath: keyof typedHypixelApi.Requests, args: { [ key: string ]: string }, name: string) { + const response = await hypixelApi.sendApiRequest(requestPath, { + key: hypixelApi.chooseApiKey(), + ...args, }) await writeTestData(requestPath, name, response) } |