I'd like to use batmanjs karma and rails on a current project. At the moment I'm attempting to use the batmanjs testing framework, but I'm having a heck of time getting everything to play together. Any help would be appreciateed.
http://batmanjs.org/docs/testing.html
class SimpleTest extends Batman.TestCase
@test 'A simple test', ->
@assert true
This file is sitting in spec/javascripts/simple_spec.js.coffee
Here's my Karma config, I'm assuming it's not accurate.
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['requirejs'],
files: [QUNIT, QUNIT_ADAPTER,
{pattern: 'spec/javascripts/*.js.coffee', included: false}
],
exclude: [
],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome', 'PhantomJS'],
captureTimeout: 60000,
singleRun: false
});
};
Again, any help would be appreciated.
Somehow you need to get Batman.TestCase (and your application code) loaded by Karma. What I've done before is (gulp) point Karma at my development server, where it can get compiled assets. Maybe it ain't perfect, but it works.
Here's an example snippet for your Karma config:
Also,I wrote up a bit about how I've done it before (with Jasmine), in case that comes in handy: http://rmosolgo.github.io/blog/2014/01/18/batman-dot-js-testing-with-karma-and-jasmine/
As mentioned there, Batman.TestCase is an "extra", so you'll have to include it "by hand". It's not in the distributed version of Batman.js
Does that help at all? Good luck!