karma-runner / karma-jasmine

A Karma plugin - adapter for Jasmine testing framework.
MIT License
542 stars 162 forks source link

Error: toEqual with arrayContaining not working (Jasmine 3.6.1) #277

Closed NoZjs closed 4 years ago

NoZjs commented 4 years ago

I just updated from version 3.5.0 to 3.6.1 and my tests using "toEqual" with "arrayContaining" are not working anymore.

Exemple: fit('test', () => { expect(['a', 'c', 'b']).toEqual(window.jasmine.arrayContaining(['c', 'b', 'a'])); });

Error: Expected [ 'a', 'c', 'b' ] to equal <jasmine.arrayContaining([ 'c', 'b', 'a' ])>. image

Documentation: https://jasmine.github.io/2.6/introduction#section-Partial_Array_Matching_with_%3Ccode%3Ejasmine.arrayContaining%3C/code%3E

Is there something I miss from the release note that break this functionnality ?

Here my package.json for the test project "devDependencies": { "@babel/cli": "^7.10.5", "@babel/core": "^7.11.4", "@babel/plugin-transform-runtime": "^7.11.0", "@babel/preset-env": "^7.11.0", "@babel/runtime-corejs3": "^7.11.2", "es6-plato": "^1.2.3", "istanbul-instrumenter-loader": "^3.0.1", "jasmine": "^3.6.0", "jasmine-promises": "^0.4.1", "karma": "^5.1.1", "karma-chrome-launcher": "^3.1.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "^4.0.1", "karma-junit-reporter": "^2.0.1", "karma-sourcemap-loader": "^0.3.8", "karma-webpack": "^4.0.2", "puppeteer": "^5.2.1", "regenerator-runtime": "^0.13.7", "webpack": "^4.44.1" },

CLOSED : SORRY I posted this in the wrong package.