diff options
Diffstat (limited to 'api/tests/routes.test.ts')
-rw-r--r-- | api/tests/routes.test.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/api/tests/routes.test.ts b/api/tests/routes.test.ts index 35d74a94..c915fab9 100644 --- a/api/tests/routes.test.ts +++ b/api/tests/routes.test.ts @@ -23,10 +23,10 @@ export const ajv = new Ajv({ }); addFormats(ajv); -var token: string; -var user: User; -var guild: Guild; -var channel: Channel; +let token: string; +let user: User; +let guild: Guild; +let channel: Channel; const request = async (path: string, opts: any = {}): Promise<any> => { const response = await fetch(`http://localhost:3001/api${path}`, { @@ -41,7 +41,7 @@ const request = async (path: string, opts: any = {}): Promise<any> => { }); if (response.status === 204) return; - var data = await response.text(); + let data = await response.text(); try { data = JSON.parse(data); if (response.status >= 400) throw data; @@ -95,13 +95,13 @@ describe("Automatic unit tests with route description middleware", () => { } const urlPath = path.replace(":id", user.id).replace(":guild_id", guild.id).replace(":channel_id", channel.id) || route.test?.path; - var validate: any; + let validate: any; if (route.test.body) { validate = ajv.getSchema(route.test.body); if (!validate) return done(new Error(`Response schema ${route.test.body} not found`)); } - var body = ""; + let body = ""; let eventEmitted = Promise.resolve(); if (route.test.event) { |