From f12c5bee3916e20e868b264e789e2fc4024ab4e4 Mon Sep 17 00:00:00 2001 From: Michael Heuberger Date: Fri, 1 Nov 2024 16:37:35 +1300 Subject: [PATCH] rearrange exports --- package.json | 5 +++-- src/__tests__/client.test.ts | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d8980da4..4ef553e1 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,10 @@ "type": "module", "exports": { "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js" }, - "source": "src/index.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/src/__tests__/client.test.ts b/src/__tests__/client.test.ts index c55bf7fe..a6e070ed 100644 --- a/src/__tests__/client.test.ts +++ b/src/__tests__/client.test.ts @@ -1,4 +1,4 @@ -import Client from ".."; +import VideomailClient from "../client"; const mock = { onHide() {}, @@ -6,18 +6,18 @@ const mock = { describe("Client", () => { test("Constructor with default arguments", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); expect(videomailClient.isBuilt()).toBeFalsy(); }); test("Constructor throws error when width is not divisible by two", () => { expect(() => { - new Client({ video: { width: 99 } }); + new VideomailClient({ video: { width: 99 } }); }).toThrowError(/Width must be divisible by two/u); }); test("Showing it sets its built flag to true", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); videomailClient.show(); @@ -25,7 +25,7 @@ describe("Client", () => { }); test("Hiding emits hide event", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); const onHideSpy = vi.spyOn(mock, "onHide"); @@ -41,7 +41,7 @@ describe("Client", () => { }); test("On unload, hidden and not built", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); videomailClient.show(); videomailClient.unload(); @@ -50,14 +50,14 @@ describe("Client", () => { }); test("Not dirty when just shown", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); videomailClient.show(); expect(videomailClient.isDirty()).toBeFalsy(); }); test("Not recording when just shown", () => { - const videomailClient = new Client(); + const videomailClient = new VideomailClient(); videomailClient.show(); expect(videomailClient.isRecording()).toBeFalsy();