Jasmine Cheat Sheet



Update: If you are using Jasmine 2.0 or above, the information here is out of date! Please go to http://jasmine.github.io/2.0/introduction.html#section-Spies instead.

White rices like jasmine rice or basmati rice cook the fastest, clocking in at around 20 minutes, whereas brown rice needs closer to 40 minutes. If the cheat sheet listed cook + release time individually it would be a useful sheet. Jasmine is my testing framework of choice when I’m writing Angular. And I was just getting used to all those spy methods with the help of Toby Ho’s cheat sheet, and then Jasmine 2 came along and changed all the method names. So here’s an updated cheat sheet for spying with Jasmine 2. Create a spy Spy on an existing method. INSTANT POT CHEAT SHEETINSTANT POT CHEAT SHEET FOR ALL ITEMS LISTED: fresh (not frozen) Pressure: high Setting: manual Liquid: minimum 1 cup water. Basmati, Jasmine Rice, Brown Rice, White Rice, Wild Spaghetti Steel Cut Oats DRIED rice & grains LIQUID RELEASE RATIO 1:3 1:2 1:2 1:2 1:1.75 1:2 1:1 1:2.5 1:4 1:1 1:1 1:1 1:1 1:2 1:2 1:3 QPR QPR. Jasmine-jQuery Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser. JQuery Matchers toBeChecked Only for tags that have checked attribute. Expect ($ (' ')). ToBeChecked toBeDisabled.

Wanna be a spy fast? Well you are in luck!

Just kidding! This is actually a cheatsheet for JasmineSpies.

See, while Jasmine itself is very intuitive to use, every time use spies I have to look up thedocs. I would blame it on the poorly chosen method/property names, but I won't. Instead I finally wrote myself a cheatsheet. I hope it helps other folks too.

How to spy on a method?

How to verify it was called?

Jasmine

How to verify it was called with specific arguments?

How many times was it called?

What were the arguments to the last call?

How to reset all the calls made to the spy so far?

How to make a standalone spy function?

How to have spied method also calls through to the real function?

Update: if you are using Jasmine 2, andCallThrough() has been changed to and.callThrough().

How to get all arguments for all calls that have been made to the spy?

Karma Jasmine Angular Cheat Sheet

How do I fix the return value of a spy?

Angular Jasmine Cheat Sheet

Update: if you are using Jasmine 2, andReturn(value) has been changed to and.returnValue(value).

Ps4