Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filoxo committed Jul 17, 2020
1 parent 1f10810 commit f879db0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 10 additions & 3 deletions browser-test/test.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
});
10 changes: 9 additions & 1 deletion node-test/main.test.mjs
Original file line number Diff line number Diff line change
@@ -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);
});
});

0 comments on commit f879db0

Please sign in to comment.