Skip to content

Instantly share code, notes, and snippets.

@kingcons
Created July 5, 2016 02:13
Show Gist options
  • Select an option

  • Save kingcons/db5e8ed22d3365a2b2eb5986db1fc4f4 to your computer and use it in GitHub Desktop.

Select an option

Save kingcons/db5e8ed22d3365a2b2eb5986db1fc4f4 to your computer and use it in GitHub Desktop.

Revisions

  1. kingcons created this gist Jul 5, 2016.
    20 changes: 20 additions & 0 deletions test_lib.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    let it = function (description, contents) {
    console.log('\n\n"It ' + description + '"');
    contents();
    };

    let expect = function (target) {
    return {
    toBe: function(expectation) {
    if (target === expectation) {
    console.log('\n %cPASSED', 'color:green;', 'Expected', target, 'to be', expectation);
    return true;
    } else {
    console.log('\n %cFAILED', 'color:red;', 'Expected', target, 'to be', expectation);
    return false;
    }
    }
    };
    };

    export {it, expect};