'use strict';

var tests = Object.keys(window.__karma__.files).filter(function (file) {
  console.log(file);
  return /-spec\.js$/.test(file);
});


require.config({
  baseUrl:         '/base/app',
  paths: {
    text:          '../lib/requirejs-text/text',
    hbs:           '../lib/backbone.marionette.hbs/backbone.marionette.hbs',
    handlebars:    '../lib/handlebars/handlebars',
    lodash:        '../lib/lodash/lodash',
    backbone:      '../lib/backbone/backbone',
    marionette:    '../lib/backbone.marionette/lib/backbone.marionette'
  },

  map: {
    '*': { 'underscore': 'lodash' }
  },

  shim: {
    'backbone': {
      deps: ['lodash', 'jquery'],
      exports: 'Backbone'
    },

    'marionette': {
      deps: ['backbone'],
      exports: 'Backbone.Marionette'
    },

    'handlebars': {
      exports: 'Handlebars'
    }
  },
  // ask Require.js to load these files (all our tests)
  deps: tests,

  // start test run, once Require.js is done
  callback: window.__karma__.start

});

@@ -85,29 +85,8 @@
 ) %7B%0A
-  console.log(file);%0A
   re
@@ -91,17 +91,16 @@
 return /
--
 spec%5C.js
@@ -176,24 +176,67 @@
 %0A  paths: %7B%0A
+    jquery:        '../lib/jquery/jquery',%0A
     text:   

add jquery and tweak spec matcher