I'm working on arrow library where I'm creating a function that returns only elements with type Symbol.
I use the filter function on an array :
export const extractSymbol = array => {
if (isArray(array)) {
return array.filter(value => typeof value === "symbol")
}
}
But because I'm creating tests before the implementation, This test fail :
expect(extractSymbol([1, 2, 4, Symbol('vue'), Symbol('react')])).toStrictEqual([Symbol('vue'), Symbol('react')]);
I expected true but it returns :
Expected: [Symbol(vue), Symbol(react)]
Received: serializes to the same string