From f879db0ed83c70c967d93e93e6af9fbc66c68701 Mon Sep 17 00:00:00 2001 From: Carlos Filoteo Date: Fri, 17 Jul 2020 09:49:35 -0600 Subject: [PATCH] Update tests --- browser-test/test.js | 13 ++++++++++--- node-test/main.test.mjs | 10 +++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/browser-test/test.js b/browser-test/test.js index ac6b3b3..91c0ffb 100644 --- a/browser-test/test.js +++ b/browser-test/test.js @@ -1,9 +1,16 @@ -describe("@esm-bundle/autopublish-template", () => { +describe("@esm-bundle/styled-components", () => { it("can load the ESM bundle", () => { - return import("/base/esm/index.js"); + return import("/base/esm/index.resolved.js"); }); it("can load the System.register bundle", () => { - return System.import("/base/system/index.js"); + return System.import("/base/system/index.js").then((module) => { + expect(module.default).toBeDefined(); + expect(module.__esModule).toEqual(true); + // Default export + expect(typeof module.default.div).toBe("function"); + // Named export + expect(typeof module.keyframes).toBe("function"); + }); }); }); diff --git a/node-test/main.test.mjs b/node-test/main.test.mjs index 403a7ad..3cacc19 100644 --- a/node-test/main.test.mjs +++ b/node-test/main.test.mjs @@ -1,5 +1,13 @@ -describe("@esm-bundle/autopublish-template", () => { +describe("@esm-bundle/styled-components", () => { it("can load the esm bundle without dying", () => { return import("../esm/index.js"); }); + + it("has API exports defined", async () => { + const { default: styled, keyframes } = await import("../esm/index.js"); + + expect(styled.div).not.to.equal(undefined); + expect(keyframes).not.to.equal(undefined); + expect(styled.keyframes).to.equal(undefined); + }); });