Skip to content

Instantly share code, notes, and snippets.

@git-toni
Last active March 25, 2016 18:35
Show Gist options
  • Save git-toni/f1b420c147eade9258de to your computer and use it in GitHub Desktop.
Save git-toni/f1b420c147eade9258de to your computer and use it in GitHub Desktop.
Testing Mithriljs module
;(function(){
var test = require('tape');
//global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var m = require('mithril');
var Module = require('../module.js');
var config={
url:'/urltoken',
title:'Hello there'
}
var modu=m.component(Module,{resource:config});
test('constructor ',function(t){
t.equal(modu.controller().url,config.url);
t.end();
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment