Sebastian
Sebastian

Reputation: 1315

Are there any differences between jasmine and expect?

I watched a tutorial where the author's advice is to use the expect framework to write better assertions: https://github.com/mjackson/expect.

  1. But as far as I can see, this is exactly the same as jasmine, and jasmine is far better known. Did jasmine absorb the expect library?

  2. Is there any practical difference between the two?

Upvotes: 2

Views: 295

Answers (1)

Frank V
Frank V

Reputation: 25429

Jasmine is a complete testing framework. expect is just the assertions and would be used in conjunction with something like mocha.

On the Jasmine home page:

BATTERIES INCLUDED

Comes out of the box with everything you need to test your code.

Where as on expect:

You can think of expect as a more compact alternative to Chai or Sinon.JS

I read this article a few days ago in deciding what to use for a project. It was a good read and insightful. Check section 1 (API) for where expect (or similar? there are two expect libraries apparently) fits in to the picture.

http://thejsguy.com/2015/01/12/jasmine-vs-mocha-chai-and-sinon.html

Upvotes: 3

Related Questions