question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adapt jasmine tests for jasmine-core@3

See original GitHub issue
npm i jasmine-core@3.3.0 karma.jasmine@2.0.1
npm run test-jasmine -- --nowatch

make numerous tests fail, spits out deprecation warnings:

image

and doesn’t get along with our negateIf custom matcher

https://github.com/plotly/plotly.js/blob/cbaae9a41e95161a839d2084ac984863f427f10d/test/jasmine/assets/custom_matchers.js#L212-L215

image


More info about jasmine@3:

https://github.com/jasmine/jasmine/blob/master/release_notes/3.0.md

More info about karma-jasmine@2:

https://github.com/karma-runner/karma-jasmine/blob/master/CHANGELOG.md#200-2018-11-15

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
etpinardcommented, Jun 12, 2019

jasmine-core@3.3.0 added expect(...).withContext('extra message').toEqual(...) to (finally) make toEqual(...) log extra info in failure messages.

https://github.com/jasmine/jasmine/blob/master/release_notes/3.3.0.md

🎉

1reaction
etpinardcommented, Jun 12, 2019

Things are looking up!

By setting random: false thus making our test running in order (like they are currently) make npm run test-jasmine run smooth ⛵

https://github.com/plotly/plotly.js/compare/bump-jasmine

Now, the main “blocker” is negateIf. We either:

  • convert its declaration to something that jasmine-core@v3 is ok with (see src for inspiration), or
  • 🔪 it and adapt the tests currently using negateIf .

As adding stuff to the jasmine.Expectation prototype isn’t recommended in jasmine docs, I’ll vote for the 🔪 . Does anyone oppose?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the jasmine-core.core function in jasmine-core
To help you get started, we've selected a few jasmine-core examples, based on popular ways it is used in public projects. ; */...
Read more >
Getting Started - Jasmine Documentation
Set jasmine as your test script in your package.json "scripts": { "test": "jasmine" }. Run your tests npm test. More Information ...
Read more >
jasmine parameterized unit test - Stack Overflow
I have tested it with the Jest test framework, but it should work with Jasmine as well. Share.
Read more >
Angular Unit testing with Jasmine | Web Age Solutions
Angular Unit testing with Jasmine. October 22, 2021 by Karandeep Kaur. Category: Angular. Author: David Chung. This tutorial is adapted from the Web...
Read more >
Unit Testing with Jasmine: An Introduction | by Paige Finkelstein
In this post I'll discuss getting started with unit testing with Jasmine, including how to set up tests for an Angular 2 application....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found