How can I properly run jasmine tests using jasmine-node and RequireJS?
I already tried something like this, but doesnt work (CoffeeScript):
requirejs = require 'requirejs'
requirejs.config { baseUrl: __dirname + '/../' }
requirejs ['MyClasses', 'FooClass'], (MyClasses, FooClass) ->
describe "someProp", ->
it "should be true", ->
expect(MyClasses.FooClass.someProp).toEqual true
Finished in 0 seconds 0 tests, 0 assertions, 0 failures
My goal is to write modular classes using RequireJS, CoffeeScript and classes must be testable with jasmine-node (CI server).
How can I do that please? Thank you!
EDIT:
I executing tests with command (at directory with tests):
jasmine-node ./
console.log 'hello'
inside therequirejs
block, does it print? Inside theit
? How about outside therequirejs
block? – AlboranOutside
of requirejs block will print "hello" first. Second will be "hello"inside
requirejs block, "hello" fromit
block doesnt print. – Skiverjasmine-node --coffee --verbose ./
? Also, what is your spec file named? I think it has to have "spec" as part of the name, as inFoo.spec.coffee
. – Alboran