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
The goal of this function is to find the asymmetric difference between two or more arrays. However, I found a silent bug when I was adding more unit tests.
it('should return an array with the uncommon elements between arrays ',()=>{expect(diff([1,2],[1,2,5])).toStrictEqual([5]);// passedexpect(diff([1,2],[1,2,3],[1,2,3,4])).toStrictEqual([4]);// failedexpect(diff(['a','b'],['b','a'],['a','b','c'])).toStrictEqual(['c']);// failedexpect(diff([null],[undefined,null],[undefined,null,'Ala'])).toStrictEqual(['Ala']);//failedexpect(diff(['diorite','andesite','grass','dirt','pink wool','dead shrub'],['diorite','andesite','grass','dirt','dead shrub'])).toStrictEqual(['pink wool']);// failed});it('should return an empty array ',()=>{expect(diff([1,2],[1,2],[1,2])).toStrictEqual([]);//failed});it('should return the original array ',()=>{expect(diff([1,2])).toStrictEqual([1,2]);//failed});
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
Targeted file: difference. js
Description:
The goal of this function is to find the asymmetric difference between two or more arrays. However, I found a silent bug when I was adding more unit tests.
Current implementation
New implementation
Expected failed tests:
The text was updated successfully, but these errors were encountered: