Skip to content

Instantly share code, notes, and snippets.

@odoe
Created May 7, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/cf5c0538e7171d341e4d93ca831412e1 to your computer and use it in GitHub Desktop.
Save odoe/cf5c0538e7171d341e4d93ca831412e1 to your computer and use it in GitHub Desktop.
// tests/unit/widgets/Profile.ts
// Add the assertionTemplate module
import assertionTemplate from "@dojo/framework/testing/assertionTemplate";
...
// Create my assertion
const profileAssertion = assertionTemplate(() =>
v("h1", { classes: [css.root], "~key": "welcome" }, ["Welcome Stranger!"])
);
describe("Profile", () => {
it("default renders correctly", () => {
const h = harness(() => w(Profile, {}));
// Test against my base assertion
h.expect(profileAssertion);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment