What is JavascriptMVC's assertEqual function?

7.2k Views Asked by At

I'm a total noob to JavascriptMVC so I'm going through the tutorials. But I have to say something that I'm sure is very simple is totally confusing me. In some of thier tutorials they reference a function assertEqual(). Whenever I try to run this in a dev environment my debug tools tell me it can't find the assertEqual function. What am I missing? Here's a link to an example of where they use assertEqual:

http://javascriptmvc.com/docs.html#!mvc.class

The first reference to it is in the code under the Instantiation sub heading. Thanks!

2

There are 2 best solutions below

1
On BEST ANSWER

They are just writing bad examples. It's supposed to illustrate that something is equal to something else.

A naive implementation of assertEqual would be

function assertEqual(a, b) {
  if (a !== b) {
    throw new Error('values are not equal');
  }
}
0
On

I visited the link -- I think its a typo in the documentation. Try assertEqual.