Expected [ ] to be [ ] Jasmine, how to check empty array

toBe doesn’t check the contents of the array, it only checks if the references are the same.

expect([1]).toBe([1]) will fail because the references are different.

You should use toEqual, which has some smarts to check the array contents as opposed to just doing a reference comparison.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)