Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. ReferenceError: fixture is not defined
  2. at <Jasmine>
  3. at UserContext.<anonymous> (test/my-component.test-without-openwc.js:19:16)
  4. at <Jasmine>
  5.  
  6. const templateString = `<div id="mydiv" name="mydiv"><p>Hello world 2!</p></div>`;
  7. const template = document.createElement("template");
  8. template.innerHTML = templateString;
  9.  
  10. export class MyComponent extends HTMLElement {
  11. constructor() {
  12. super();
  13. const shadowRoot = this.attachShadow({ mode: "open" });
  14. shadowRoot.appendChild(template.content.cloneNode(true));
  15. }
  16. }
  17. customElements.define("my-component", MyComponent);
  18.  
  19. module.exports = function(config) {
  20. config.set({
  21. basePath: "",
  22. frameworks: ["fixture","jasmine"],
  23. files: [
  24. "node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
  25. {
  26. pattern: "**/*.test-without-openwc.js",
  27. type: "module",
  28. included: true
  29. },
  30. { pattern: "**/*.js", type: "module", included: false }
  31. ],
  32. exclude: [],
  33. preprocessors: {},
  34. reporters: ["spec"],
  35. port: 9876,
  36. colors: true,
  37. logLevel: config.LOG_INFO,
  38. autoWatch: true,
  39. browsers: ["Chrome"],
  40. singleRun: true,
  41. concurrency: Infinity
  42. });
  43. };
  44.  
  45. it("second try (using fixture)", async () => {
  46. //const el = await fixture("<my-component></my-component>");
  47. const el = await fixture.load("<my-component></my-component>");
  48. expect(el.success).to.be.false;
  49. //expect(el.querySelector("mydiv")).toBeTruthy();
  50. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement