Skip to content

Instantly share code, notes, and snippets.

@thraxil
Created August 25, 2015 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thraxil/3d56624d1570f9507b81 to your computer and use it in GitHub Desktop.
Save thraxil/3d56624d1570f9507b81 to your computer and use it in GitHub Desktop.
var requirejs = require('requirejs');
var jsdom = require('mocha-jsdom');
var assert = require('assert');
requirejs.config(require('../../config/test_config').options);
describe('models/user', function() {
jsdom();
// local operations on a model should be fast
this.slow(1);
// obnoxious setup to get mocha and require.js to play
// well together.
var user;
beforeEach(function(done) {
requirejs(['models/user'], function(_Module) {
user = _Module;
done();
})
});
describe('instantiate', function() {
it('should be possible to instantiate a user', function() {
var u = new user();
assert(typeof u !== undefined);
});
});
});
@nikolas
Copy link

nikolas commented Aug 25, 2015

typeof returns a string, so line 26 should be assert(typeof u !== 'undefined');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment