Week 1 HW Submission for J.Sorge#30
Week 1 HW Submission for J.Sorge#30Jiansorge wants to merge 1 commit intomodern-web-application-uw19:masterfrom
Conversation
|
how do I make the test work? |
| } | ||
|
|
||
| render() { | ||
| return '<${this.tag}>${this.content}</${this.tag}>'; |
There was a problem hiding this comment.
Remember when using this syntax you need to begin and end with ` not a regular apostrophe '
| clearInterval(timerInterval); | ||
| } | ||
| start() { | ||
| this.timerInterval = setInterval(() => { |
There was a problem hiding this comment.
Reserve this for persistent variables that are attached to the class. timerInterval is better defined using const.
| start() { | ||
| this.timerInterval = setInterval(() => { | ||
| if (this.seconds === 0) { | ||
| clearInterval(timerInterval); |
There was a problem hiding this comment.
You defined timerInterval with this.timerInterval, so on this line it will evaluate to undefined since you did not include 'this' keyword
| class DivElement extends HTMLElement { | ||
| constructor(content) { | ||
| super('div', content); | ||
| // this.content = content; |
|
Glad you got the tests to run, the intent of the assignment was to complete the tasks and get all tests to pass. You can ignore most of the warnings but try to get tests to pass. They include line numbers telling you where and why the tests failed. Read my comments for more info. |
Week 1 HW Submission
Not sure how to use npm test.
npm test gave me errors below.. are these fine to ignore?:
/HTMLElement.js
8:9 error Expected 'this' to be used by class method 'render' class-methods-use-this
9:12 error Unexpected template string expression no-template-curly-in-string
/Timer.js
9:23 error 'timerInterval' is not defined no-undef
12:7 warning Unexpected console statement