I am writing unit test using Jasmine in a web app using BackboneJS.
There are a lot of examples showing you how to check a value in this way:
it("should set the id property to default value", function()
{
expect(this.task.get("id")).toEqual(null);
});
But I can’t find any example checking if an attribute whether is number or string in Javascript using Jasmine.
Is it appropriate to make a check like this?
If yes, what is the proper way to make it?
Example: I want to check if the id is an integer > 0. How can I make it in Jasmine?
I would make something like this: