Permalink
Browse files

provide alternate vendor files in different karma configuration files

  • Loading branch information...
1 parent 13abd6a commit 9e7cec184783856809123ddb06c761fc7a8466f2 @makeusabrew committed Aug 28, 2013
Showing with 66 additions and 40 deletions.
  1. +49 −39 karma-base.conf.js
  2. +8 −0 karma-jquery-latest.conf.js
  3. +8 −0 karma.conf.js
  4. +1 −1 package.json
View
@@ -1,41 +1,51 @@
-module.exports = function(config) {
-
- return config.set({
- basePath: "",
- frameworks: ["mocha", "chai"],
- files: [
- "node_modules/sinon/lib/sinon.js",
- "node_modules/sinon/lib/sinon/spy.js",
- "node_modules/sinon/lib/sinon/stub.js",
- "node_modules/sinon-chai/lib/sinon-chai.js",
- "tests/vendor/jquery-1.8.3.min.js",
- "tests/vendor/bootstrap-3.0.0.min.js",
- "bootbox.js",
- "tests/**/*.test.coffee",
- "tests/**/*.test.js"
- ],
- exclude: [],
- preprocessors: {
- "**/*.coffee": ["coffee"],
- "bootbox.js": ["coverage"]
- },
- reporters: ["dots", "coverage", "junit"],
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- autoWatch: true,
- browsers: ["PhantomJS"],
- captureTimeout: 60000,
- singleRun: false,
-
- coverageReporter: {
- type: "cobertura",
- dir: "tests/coverage"
- },
-
- junitReporter: {
- outputFile: "tests/reports/results.xml"
- }
- });
+module.exports = function(params) {
+
+ "use strict";
+
+ console.log("Vendor files: " + params.vendor.join(", "));
+
+ return function(config) {
+
+ return config.set({
+ basePath: "",
+ frameworks: ["mocha", "chai"],
+ files: Array.prototype.concat([
+ "node_modules/sinon/lib/sinon.js",
+ "node_modules/sinon/lib/sinon/spy.js",
+ "node_modules/sinon/lib/sinon/stub.js",
+ "node_modules/sinon-chai/lib/sinon-chai.js"],
+
+ params.vendor,
+
+ params.src || "bootbox.js",
+
+ ["tests/**/*.test.coffee",
+ "tests/**/*.test.js"]
+ ),
+ exclude: [],
+ preprocessors: {
+ "**/*.coffee": ["coffee"],
+ "bootbox.js": ["coverage"]
+ },
+ reporters: ["dots", "coverage", "junit"],
+ port: 9876,
+ colors: true,
+ logLevel: config.LOG_INFO,
+ autoWatch: true,
+ browsers: ["PhantomJS"],
+ captureTimeout: 60000,
+ singleRun: true,
+
+ coverageReporter: {
+ type: "cobertura",
+ dir: "tests/coverage"
+ },
+
+ junitReporter: {
+ outputFile: "tests/reports/results.xml"
+ }
+ });
+
+ };
};
@@ -0,0 +1,8 @@
+var baseConfig = require("./karma-base.conf");
+
+module.exports = baseConfig({
+ vendor: [
+ "tests/vendor/jquery-1.10.2.min.js",
+ "tests/vendor/bootstrap-3.0.0.min.js"
+ ]
+});
View
@@ -0,0 +1,8 @@
+var baseConfig = require("./karma-base.conf");
+
+module.exports = baseConfig({
+ vendor: [
+ "tests/vendor/jquery-1.8.3.min.js",
+ "tests/vendor/bootstrap-3.0.0.min.js"
+ ]
+});
View
@@ -6,7 +6,7 @@
"test": "tests"
},
"scripts": {
- "test": "./node_modules/.bin/karma start --single-run --browsers PhantomJS --reporters dots"
+ "test": "./node_modules/.bin/karma start"
},
"repository": {
"type": "git",

0 comments on commit 9e7cec1

Please sign in to comment.