This document provides a cheat sheet for Jasmine JS testing with summaries of key Jasmine statements, matchers, and spies. It lists statements like describe(), it(), expect(), beforeEach(), and afterEach() to group and label tests. It outlines matchers like toBe(), toEqual(), toMatch(), and toContain() for making assertions. And it presents spies like spyOn() to spy on methods and matchers like toHaveBeenCalled() to check spy calls.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
118 views1 page
Jasmine JS Testing Cheat Sheet: by Via
This document provides a cheat sheet for Jasmine JS testing with summaries of key Jasmine statements, matchers, and spies. It lists statements like describe(), it(), expect(), beforeEach(), and afterEach() to group and label tests. It outlines matchers like toBe(), toEqual(), toMatch(), and toContain() for making assertions. And it presents spies like spyOn() to spy on methods and matchers like toHaveBeenCalled() to check spy calls.
run after each it in the describe toBeLessThan( number ) andCallThrough ()
toBeGreaterThan ( number ) spy and delegate to real object xdescribe( label, function(){ ... }) toBeNaN() skip section ( note the x ) andReturn( value ) toBeCloseTo ( number, precision ) andCallFake(function() { ... }) xit( label, function(){ ... }) toThrow() skip test ( note the x ) jasmine.createSpy ( id ) Matchers can be chained with a not between jasmine.createSpyObj( baseName, the actual and assertion. methods[] )
jasmine.any( constructor )
By Ryan Johnson (CITguy) Published 14th May, 2013. Sponsored by Readability-Score.com
cheatography.com/citguy/ Last updated 1st June, 2014. Measure your website readability! Page 1 of 1. https://readability-score.com