From 0af9bc841ffe1a297d308500d696bad4b85abda9 Mon Sep 17 00:00:00 2001 From: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com> Date: Sun, 13 Feb 2022 07:37:41 -0500 Subject: [PATCH] fix(ci): ci error (#7454) Co-authored-by: Almeida --- packages/discord.js/typings/index.test-d.ts | 2 +- packages/rest/__tests__/util.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/rest/__tests__/util.ts diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 9abeb006c583..8cf019688a45 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -1337,5 +1337,5 @@ const selectMenu = new SelectMenuComponent({ }); new ActionRow({ - components: [selectMenu, button], + components: [selectMenu.toJSON(), button.toJSON()], }); diff --git a/packages/rest/__tests__/util.ts b/packages/rest/__tests__/util.ts new file mode 100644 index 000000000000..895f021b64d9 --- /dev/null +++ b/packages/rest/__tests__/util.ts @@ -0,0 +1,14 @@ +import { DefaultRestOptions } from '../src'; + +export function genPath(path: string) { + return `/api/v${DefaultRestOptions.version}${path}`; +} + +export function jsonHeaders(headers: Record = {}) { + return { + headers: { + 'content-type': 'application/json', + ...headers, + }, + }; +}