Skip to content

Instantly share code, notes, and snippets.

@marqueymarc
Created July 7, 2016 04:59
Show Gist options
  • Save marqueymarc/fec5cb7b5d6eb23fe16befc7fa75b48c to your computer and use it in GitHub Desktop.
Save marqueymarc/fec5cb7b5d6eb23fe16befc7fa75b48c to your computer and use it in GitHub Desktop.
simple jasmine/mocha inline
<j20-script>
j20Init(function () {
'use strict';
var bef;
function beforeEach(f) {
bef = f;
}
function it(str, f) {
bef();
console.log('running ' + str);
f();
}
function expect(val) {
return {
toBe: function (x) {
if (x !== val) {
console.log('fail expected ', x, ' got ', val);
}
else {
console.log('....ok');
}
},
toEqual: function (x) {
if (!angular.equals(x, val)) {
console.log('fail expected ', x, ' got ', val);
}
else {
console.log('....ok');
}
}
}
}
</j20-script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment