diff --git a/package.json b/package.json index b203c75e..3349db9e 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,27 @@ { - "name": "leaflet", - "version": "0.6.3", - "description": "JavaScript library for mobile-friendly interactive maps", - "devDependencies": { - "jshint": "~2.1.10", - "mocha": "~1.12.1", - "happen": "~0.1.3", - "karma": "~0.10.2", - "uglify-js": "~2.4.0", - "jake": "~0.6.11" - }, - "main": "dist/leaflet.js", - "scripts": { - "test": "jake test", - "prepublish": "jake" - }, - "repository": { - "type": "git", - "url": "git://github.com/Leaflet/Leaflet.git" - }, - "keywords": ["gis", "map"] + "name": "leaflet", + "version": "0.6.3", + "description": "JavaScript library for mobile-friendly interactive maps", + "devDependencies": { + "jshint": "~2.1.10", + "mocha": "~1.12.1", + "happen": "~0.1.3", + "karma": "~0.10.2", + "uglify-js": "~2.4.0", + "jake": "~0.6.11", + "karma-mocha": "~0.1.0" + }, + "main": "dist/leaflet.js", + "scripts": { + "test": "jake test", + "prepublish": "jake" + }, + "repository": { + "type": "git", + "url": "git://github.com/Leaflet/Leaflet.git" + }, + "keywords": [ + "gis", + "map" + ] } diff --git a/spec/after.js b/spec/after.js index 7dcd1d9b..94d1dfee 100644 --- a/spec/after.js +++ b/spec/after.js @@ -1,2 +1,2 @@ // put after Leaflet files as imagePath can't be detected in a PhantomJS env -L.Icon.Default.imagePath = "../dist/images"; +L.Icon.Default.imagePath = "/base/dist/images"; diff --git a/spec/karma.conf.js b/spec/karma.conf.js index 3bc1f077..0ed3f828 100644 --- a/spec/karma.conf.js +++ b/spec/karma.conf.js @@ -1,64 +1,65 @@ // Karma configuration -var libSources = require(__dirname+'/../build/build.js').getFiles(); +module.exports = function (config) { -// base path, that will be used to resolve files and exclude -basePath = ''; + var libSources = require(__dirname+'/../build/build.js').getFiles(); -for (var i=0; i < libSources.length; i++) { - libSources[i] = "../" + libSources[i]; -} + var files = [ + "spec/before.js", + "spec/sinon.js", + "spec/expect.js" + ].concat(libSources, [ + "spec/after.js", + "node_modules/happen/happen.js", + "spec/suites/SpecHelper.js", + "spec/suites/**/*.js", + {pattern: "dist/images/*.png", included: false} + ]); -// list of files / patterns to load in the browser -files = [].concat([ - "../node_modules/mocha/mocha.js", - MOCHA_ADAPTER, - "before.js", - "sinon.js", - "expect.js" -], libSources, [ - "after.js", - "../node_modules/happen/happen.js", - "suites/SpecHelper.js", - "suites/**/*.js" -]); + config.set({ + // base path, that will be used to resolve files and exclude + basePath: '../', -// list of files to exclude -exclude = [ -]; + plugins: ['karma-mocha', 'karma-phantomjs-launcher'], -// test results reporter to use -// possible values: 'dots', 'progress', 'junit' -reporters = ['dots']; + // frameworks to use + frameworks: ['mocha'], -// web server port -port = 8080; + // list of files / patterns to load in the browser + files: files, + exclude: [], -// cli runner port -runnerPort = 9100; + // test results reporter to use + // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' + reporters: ['dots'], -// enable / disable colors in the output (reporters and logs) -colors = true; + // web server port + port: 9876, -// level of logging -// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG -logLevel = LOG_WARN; + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_WARN, -// enable / disable watching file and executing tests whenever any file changes -autoWatch = false; + // enable / disable colors in the output (reporters and logs) + colors: true, -// Start these browsers, currently available: -// - Chrome -// - ChromeCanary -// - Firefox -// - Opera -// - Safari (only Mac) -// - PhantomJS -// - IE (only Windows) -browsers = ['PhantomJS']; + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, -// If browser does not capture in given timeout [ms], kill it -captureTimeout = 5000; + // Start these browsers, currently available: + // - Chrome + // - ChromeCanary + // - Firefox + // - Opera + // - Safari (only Mac) + // - PhantomJS + // - IE (only Windows) + browsers: ['PhantomJS'], -// Continuous Integration mode -// if true, it capture browsers, run tests and exit -singleRun = true; + // If browser does not capture in given timeout [ms], kill it + captureTimeout: 5000, + + // Continuous Integration mode + // if true, it capture browsers, run tests and exit + singleRun: true + }); +};