rishabhsrao/voxel

View on GitHub
.karmarc

Summary

Maintainability
Test Coverage
// Karma configuration
// karma-runner.github.io

module.exports = function(config) {
  var CFG = require("./tasks/utils/config.js");
  var path = require("path");

  config.set({
    basePath: "",

    frameworks: [
      "jasmine",
      "requirejs"
    ],

    files: [
      // Libraries
      { pattern: path.join(CFG.DIR.bower, "jquery", "jquery.js"), included: false },
      { pattern: path.join(CFG.DIR.bower, "es5-shim", "es5-shim.min.js"), included: false },
      { pattern: path.join(CFG.DIR.bower, "es5-shim", "es5-sham.min.js"), included: false },
      { pattern: path.join(CFG.DIR.bower, "jasmine-ajax", "lib", "mock-ajax.js"), included: false },
      { pattern: path.join(CFG.DIR.bower, "jasmine-jquery", "lib", "jasmine-jquery.js"), included: false },
      // /Libraries

      // Application
      { pattern: path.join(CFG.DIR.src, CFG.DIR.script, "**", "*." + CFG.FILE.extension.script.js), included: false },
      // /Application

      // RequireJS main config
      { pattern: path.join(CFG.DIR.test, CFG.FILE.config.testMain) },
      // /RequireJS main config

      // Test scripts and fixtures, RequireJS main config
      { pattern: path.join(CFG.DIR.test, "**", "*"), included: false }
      // /Test scripts and fixtures
    ],

    exclude: [
    ],

    reporters: [
      "spec",
      "coverage",
      "junit"
    ],

    port: 9876,

    colors: true,

    logLevel: config.LOG_INFO,

    autoWatch: false,

    browsers: [
      "PhantomJS"
    ],

    singleRun: false,

    coverageReporter: {
      reporters: [{
        type: "lcov",
        dir: path.join(CFG.DIR.report, CFG.DIR.test)
      }]
    },

    junitReporter: {
      outputDir: path.join(CFG.DIR.report, CFG.DIR.test, CFG.FILE.coverageReporter.junit),
      suite: ""
    },

    specReporter: {
       suppressPassed: false,
       suppressFailed: false,
       suppressSkipped: false
    },

    preprocessors: {
      // FIXME Remove hard-coded folder name.
      "src/scripts/*.js": [
        "coverage"
      ]
    }
  });
};