JSFiddle - React, Tailwind, and code Playground
by aknuds1
HTML
<script src="https://raw.github.com/pivotal/jasmine/master/lib/jasmine-core/jasmine.js"></script>
JavaScript
var spy = jasmine.createSpy('method').andCallFake(function() {
if (!this.hasOwnProperty('property')) {
throw new Error('Isn\'t expected object');
}
});
var obj = {
property: 'value'
};
try {
spy.apply(obj);
}
catch (err) {
console.log('Caught exception: ' + err.message);
}