Why assert throws a reference error

74 views Asked by At

I am exploring Immutablejs documentation, and I found assert to be throwing reference error. Here is my code

var map = Immutable.Map({a:1, b:2});
var map2 = map;
console.log(map);
console.log(map2);
assert(map.equals(map2) === true);

And I have included the minified version in the script tag of my page. What might be the error? Even assert(map.equals(map2)) is throwing reference error.
Do they mean to say if assert belongs to some testing framework? or is it my problem that I have included in script tag?

1

There are 1 answers

2
Himen On BEST ANSWER

Yes. There assert is a general concept in test driven developments and unit testing. You should use a assert framework like Chai or write your own framework.