From 60bb561e4941831aa15e48d1002dc32f9c018136 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sun, 29 Jan 2023 17:57:27 +0100 Subject: [PATCH] Extract tests to shared/ --- .../helpers/ircmessageparser => shared}/cleanIrcMessage.ts | 2 +- .../js/helpers/ircmessageparser => shared}/findLinks.ts | 5 +---- test/tsconfig.json | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) rename test/{client/js/helpers/ircmessageparser => shared}/cleanIrcMessage.ts (94%) rename test/{client/js/helpers/ircmessageparser => shared}/findLinks.ts (98%) diff --git a/test/client/js/helpers/ircmessageparser/cleanIrcMessage.ts b/test/shared/cleanIrcMessage.ts similarity index 94% rename from test/client/js/helpers/ircmessageparser/cleanIrcMessage.ts rename to test/shared/cleanIrcMessage.ts index 4abe23a2..1cc1ff49 100644 --- a/test/client/js/helpers/ircmessageparser/cleanIrcMessage.ts +++ b/test/shared/cleanIrcMessage.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import cleanIrcMessage from "../../../../../client/js/helpers/ircmessageparser/cleanIrcMessage"; +import {cleanIrcMessage} from "../../shared/irc"; describe("cleanIrcMessage", function () { it("should remove all formatting", function () { diff --git a/test/client/js/helpers/ircmessageparser/findLinks.ts b/test/shared/findLinks.ts similarity index 98% rename from test/client/js/helpers/ircmessageparser/findLinks.ts rename to test/shared/findLinks.ts index 350830b2..c5be4608 100644 --- a/test/client/js/helpers/ircmessageparser/findLinks.ts +++ b/test/shared/findLinks.ts @@ -1,8 +1,5 @@ import {expect} from "chai"; -import { - findLinks, - findLinksWithSchema, -} from "../../../../../client/js/helpers/ircmessageparser/findLinks"; +import {findLinks, findLinksWithSchema} from "../../shared/linkify"; describe("findLinks", () => { it("should find url", () => { diff --git a/test/tsconfig.json b/test/tsconfig.json index 27207ccc..b4485495 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -3,7 +3,8 @@ "include": [ "**/*", "../client", - "../server" + "../server", + "../shared" ] /* Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later. */, "files": [ "../babel.config.cjs",