Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for arcgis js api 3.x. #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions karma.arcgis3.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For more details see: https://github.com/tomwayson/esri-karma-tutorial
module.exports = function(config) {
config.set({
basePath: '',
port: 9877,
colors: true,
logLevel: 'INFO',
autoWatch: false,
browsers: ['PhantomJS'],
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
exitOnResourceError: false,
flags: [
'--web-security=false',
'--load-images=false',
'--ignore-ssl-errors=true'
]
},
singleRun: true,
frameworks: ['jasmine','dojo'],
reporters: ['mocha'],
files: [
'tests/config-arcgis3.js',
{pattern: 'wicket.js', included: false},
{pattern: 'wicket-arcgis-amd.js', included: false},
{pattern: 'tests/wicket-arcgis3-amd-spec.js', included: false}
],

});
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"chai": "*",
"jasmine-core": "^2.5.2",
"karma": "^1.7.1",
"karma-dojo": "0.0.1",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.4",
"karma-phantomjs-launcher": "^1.0.1",
Expand Down
63 changes: 63 additions & 0 deletions tests/config-arcgis3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
(function (window) {
'use strict';

var allTestFiles = [];
var TEST_REGEXP = /wicket-arcgis3-amd-spec.js$/;

for (var file in window.__karma__.files) {
if (TEST_REGEXP.test(file)) {
allTestFiles.push(file);
}
}
window.dojoConfig = {
tlmSiblingOfDojo: false,
packages: [
// local packages to test
{
name: "wicket-arcgis-amd",
main: "wicket-arcgis-amd",
location: '../../..'
},

// esri/dojo packages
// esri/dojo packages
{
name: 'dgrid',
location: 'http://js.arcgis.com/3.20/dgrid'
}, {
name: 'dijit',
location: 'http://js.arcgis.com/3.20/dijit'
}, {
name: 'esri',
location: 'http://js.arcgis.com/3.20/esri'
}, {
name: 'dojo',
location: 'http://js.arcgis.com/3.20/dojo'
}, {
name: 'dojox',
location: 'http://js.arcgis.com/3.20/dojox'
}, {
name: 'put-selector',
location: 'http://js.arcgis.com/3.20/put-selector'
}, {
name: 'util',
location: 'http://js.arcgis.com/3.20/util'
}, {
name: 'xstyle',
location: 'http://js.arcgis.com/3.20/xstyle'
}, {
name: 'moment',
location: 'http://js.arcgis.com/3.20/moment',
}
],
};


/**
* This function must be defined and is called back by the dojo adapter
* @returns {string} a list of dojo spec/test modules to register with your testing framework
*/
window.__karma__.dojoStart = function () {
return allTestFiles;
};
})(window);
Loading