Skip to content

Commit

Permalink
rearrange exports
Browse files Browse the repository at this point in the history
  • Loading branch information
binarykitchen committed Nov 1, 2024
1 parent 5c9469b commit f12c5be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down
16 changes: 8 additions & 8 deletions src/__tests__/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import Client from "..";
import VideomailClient from "../client";

const mock = {
onHide() {},
};

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();

expect(videomailClient.isBuilt()).toBeTruthy();
});

test("Hiding emits hide event", () => {
const videomailClient = new Client();
const videomailClient = new VideomailClient();

const onHideSpy = vi.spyOn(mock, "onHide");

Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit f12c5be

Please sign in to comment.