I am really new to javascript and I am writing some jasmine tests in a simple javascript spec. How can I imagine jquery dependencies and underscores in this specification without using requireJS.?
describe( "Testing Karma and Jasmine", function () {
describe("Hello world test", function() {
it("says hello", function() {
expect(testingJasmine()).toEqual("Hello world!");
});
});
});
describe('just checking', function() {
it('works for app', function() {
var el = $('<div></div>');
var app = restify.createServer()
app.render();
expect(el.text()).toEqual('require.js up and running');
});
it('works for underscore', function() {
expect(_.size([1,2,3])).toEqual(3);
});
});
If you look at the attached code, it will not be able to resolve the dependencies of $ (JQUERY) and _ (UNDERSCORE).
source
share