- Replace
<your_account>
with your Github username in the link - Follow this instructions
- Run
npm run test
command to test your code; - Run
npm run test:only -- -n
to run fast test ignoring linter; - Run
npm run test:only -- -l
to run fast test with additional info in console ignoring linter.
- Run
To complete this task, you should create a function that returns a Promise
.
Create function waitFor
which takes two parameters:
element
- DOM element;eventName
, such asclick
,input
andblur
. The function returns aPromise
which should be resolved wheneventName
happened onelement
. Function should return the notification message with text:It was ${eventName} on the element: ${element.nodeName}, id: ${element.id}.
For example:It was click on the element: INPUT, id: login.
Create a function printMessage
which takes one parameter message
and adds to the DOM a
element with notification message above. Notification message should have class
message
.
All promises are called in callPromise.js
file. Implement only waitFor
and printMessage
functions.
Hint: For convenience, several inputs and buttons have been added to the DOM. Use them for testing your function.