Created
January 16, 2012 07:05
-
-
Save kmiyashiro/1619504 to your computer and use it in GitHub Desktop.
test file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
js | |
model | |
user.js | |
test | |
test.js | |
Error: Calling node's require("model/user") failed with error: Error: Cannot find module 'model/user' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require("assert"), | |
requirejs = require('requirejs'); | |
requirejs.config = { | |
baseUrl: __dirname + '../js/', // Also tried just '../js' and '../js/' | |
nodeRequire: require, | |
paths: { | |
'jquery' : 'libs/jquery/jquery-1.7.min', | |
'underscore' : 'vendor/underscore', | |
'backbone' : 'vendor/backbone', | |
'visualsearch' : 'libs/backbone/visualsearch', | |
'templates' : 'templates/templates', | |
'moment' : 'libs/moment/moment.min' | |
} | |
}; | |
console.log(requirejs.config.baseUrl + 'model/user'); | |
describe('User Model', function() { | |
it('should have an ID', function() { | |
requirejs(['model/user'], function(User) { | |
var user = new User({ uuid: '123' }); | |
assert.ok(user.id); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment