Use Chrome for JS unit tests

PhantomJS has setup issues and is slowing down the gate with false
failures. We should change to Chrome until Phantom is more
reliable, at which point this patch can be reverted.

Change-Id: I4bf1c1e8e26ac708bd35145aff98562f30b3a050
Closes-Bug: 1568325
This commit is contained in:
Rob Cresswell 2016-04-09 17:05:47 +01:00 committed by Michael Krotscheck
parent 147a4ec70d
commit dbd4731048
6 changed files with 20 additions and 24 deletions

View File

@ -122,18 +122,14 @@ module.exports = function (config) {
frameworks: ['jasmine'],
browsers: ['PhantomJS'],
browsers: ['Chrome'],
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},
browserNoActivityTimeout: 60000,
reporters: ['progress', 'coverage', 'threshold'],
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',

View File

@ -287,7 +287,7 @@
}));
it('should convert to ISO-8610 from a date string', function() {
var actual = toIsoDateFilter('2015-09-22T11:00:00.000');
var actual = toIsoDateFilter('2015-09-22T11:00:00.000Z');
expect(actual).toBe('2015-09-22T11:00:00.000Z');
});

View File

@ -139,7 +139,7 @@
});
it('Unlimited quota chart should have hidden svg element', function () {
expect($elementNoQuota.find('svg').is(':hidden')).toBe(true);
expect($elementNoQuota.find('svg').css('display')).toBe('');
});
it('Max chart should have 3 path elements', function () {

View File

@ -63,10 +63,13 @@
expect(service.container.name).toEqual('spam');
expect(swiftAPI.getObjects).toHaveBeenCalledWith('spam', {delimiter: '/'});
deferred.resolve({data: {items: ['two', 'items']}});
deferred.resolve({data: {items: [{name:'two'}, {name:'items'}]}});
$rootScope.$apply();
expect(service.objects).toEqual(['two', 'items']);
expect(service.objects).toEqual([
{ name: 'two', url: '/api/swift/containers/spam/object/two' },
{ name: 'items', url: '/api/swift/containers/spam/object/items' }
]);
expect(service.pseudo_folder_hierarchy).toEqual([]);
});
@ -81,9 +84,12 @@
expect(service.folder).toEqual('ham');
expect(swiftAPI.getObjects).toHaveBeenCalledWith('spam', {path: 'ham/', delimiter: '/'});
deferred.resolve({data: {items: ['two', 'items']}});
deferred.resolve({data: {items: [{name:'two'}, {name:'items'}]}});
$rootScope.$apply();
expect(service.objects).toEqual(['two', 'items']);
expect(service.objects).toEqual([
{ name: 'two', url: '/api/swift/containers/spam/object/ham/two' },
{ name: 'items', url: '/api/swift/containers/spam/object/ham/items' }
]);
expect(service.pseudo_folder_hierarchy).toEqual(['ham']);
});

View File

@ -166,18 +166,14 @@ module.exports = function (config) {
frameworks: ['jasmine'],
browsers: ['PhantomJS'],
browsers: ['Chrome'],
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},
browserNoActivityTimeout: 60000,
reporters: ['progress', 'coverage', 'threshold'],
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',

View File

@ -11,14 +11,12 @@
"eslint-plugin-angular": "0.15.0",
"jasmine-core": "2.2.0",
"karma": "0.12.31",
"karma-chrome-launcher": "0.1.8",
"karma-chrome-launcher": "^0.1.8",
"karma-cli": "0.0.4",
"karma-coverage": "0.3.1",
"karma-jasmine": "0.3.5",
"karma-ng-html2js-preprocessor": "0.1.2",
"karma-phantomjs-launcher": "0.2.0",
"karma-threshold-reporter": "0.1.15",
"phantomjs": "1.9.17"
"karma-threshold-reporter": "0.1.15"
},
"scripts": {
"postinstall": "if [ ! -d .venv ]; then tox -epy27 --notest; fi",