You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Guys
When I go to the second step, and basic update function and run the test,
/**
* `update` transforms the `model` based on the `action`.
* @param {String} action - the desired action to perform on the model.
* @param {Object} model - the App's (current) model (or "state").
* @return {Object} new_model - the transformed model.
*/
function update(action, model) {
switch (action) { // action (String) determines which case
default: // if action unrecognised or undefined,
return model; // return model unmodified
} // default? https://softwareengineering.stackexchange.com/a/201786/211301
}
it supposed to pass the test, but there is the following error message, anyone know why?
TAP version 13
model (Object) has desired keys
ok 1 todos and hash keys are present.
ok 2 model.todos is an Array
update default case should return model unmodified
TypeError: app.update is not a function
at Test. (/Users/rushlin/Downloads/mystuff/javascript-todo-list/test/todo-app1.test.js:19:32)
at Test.bound [as _cb] (/Users/rushlin/node_modules/tape/lib/test.js:84:32)
at Test.run (/Users/rushlin/node_modules/tape/lib/test.js:101:31)
at Test.bound [as run] (/Users/rushlin/node_modules/tape/lib/test.js:84:32)
at Immediate.next (/Users/rushlin/node_modules/tape/lib/results.js:83:19)
at processImmediate (internal/timers.js:456:21)
shanshandeMacBook-Pro:javascript-todo-list rushlin$
The text was updated successfully, but these errors were encountered:
If update is not exported at the end of your /lib/todo-app.js file then it won't be accessible in your tests so you will see this app.update is not a function error.
If possible, commit your code to GitHub so we can help you debug it much faster. 💡
Hi Guys
When I go to the second step, and basic update function and run the test,
it supposed to pass the test, but there is the following error message, anyone know why?
The text was updated successfully, but these errors were encountered: