skovhus / jest-codemods

Codemods for migrating to Jest https://github.com/facebook/jest 👾
MIT License
878 stars 81 forks source link

jasmine arrayWithExactContents #610

Closed jase88 closed 2 weeks ago

jase88 commented 2 weeks ago

Given two arrays:

const array1 = [3, 1, 2];
const array2 = [1, 2, 3];

Input:

expect(array1).toEqual(jasmine.arrayWithExactContents(array2));

should be transformed to:

expect(array1.sort()).toEqual(array2.sort());