Skip to content

Instantly share code, notes, and snippets.

@vzaidman
Last active February 1, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vzaidman/ad35e2c1fa802a1dd759801c4a8753b0 to your computer and use it in GitHub Desktop.
Save vzaidman/ad35e2c1fa802a1dd759801c4a8753b0 to your computer and use it in GitHub Desktop.
// Chai expect (popular)
expect(foo).to.be.a('string')
expect(foo).to.equal('bar')
// Jasmine expect (popular)
expect(foo).toBeString()
expect(foo).toEqual('bar')
// Chai assert
assert.typeOf(foo, 'string')
assert.equal(foo, 'bar')
// Unexpected expect
expect(foo, 'to be a', 'string')
expect(foo, 'to be', 'bar')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment