Skip to content

Fixes error where app module fails to load in testing #4

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

Merged
merged 5 commits into from
Jun 7, 2016
Merged
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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: node_js
node_js: ["0.10"]
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
before_script:
- npm install -g bower gulp
- bower install
7 changes: 3 additions & 4 deletions dist/angular-zendesk-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
}

var window = $window;

// Following is essentially a copy paste of JS portion of the Zendesk embed code
// with our settings subbed in. For more info, see:
// https://support.zendesk.com/hc/en-us/articles/203908456-Using-Web-Widget-to-embed-customer-service-in-your-website

// Note that JSHint ignore is not working in latest release, so can't actually turn
// on JSHint yet. See https://github.com/jshint/jshint/issues/2411
/* jshint ignore:start */
/*eslint-disable */

window.zEmbed || function(e, t) {
var n, o, d, i, s, a = [],
Expand All @@ -35,7 +34,7 @@
}, o.write('<body onload="document._l();">'), o.close()
}("https://assets.zendesk.com/embeddable_framework/main.js", zendeskWidgetSettings.accountUrl);

/* jshint ignore:end */
/*eslint-enable */

$window.zE(function() {
zendeskWidgetSettings.beforePageLoad($window.zE);
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ gulp.task('lint', function () {
module: true,
require: true,
__dirname: true,
document: true
document: true,
process: true
}
}))
// Outputs the results to the console
Expand Down
25 changes: 18 additions & 7 deletions karma-dist-concatenated.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ module.exports = function(config) {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai-jquery', 'jquery-1.8.3', 'sinon-chai'],
frameworks: ['jasmine'],

plugins: [
'karma-mocha',
'karma-chai',
'karma-jasmine',
'karma-sinon-chai',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-jquery',
'karma-chai-jquery'
'karma-spec-reporter'
],

// list of files / patterns to load in the browser
Expand Down Expand Up @@ -67,11 +64,25 @@ module.exports = function(config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
browsers: ['Chrome'],


// Use a custom launcher to run Chrome on TravisCI
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});

// Switch browser to Chrome if TravisCI is detected
if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
}
};
24 changes: 17 additions & 7 deletions karma-dist-minified.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ module.exports = function(config) {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai-jquery', 'jquery-1.8.3', 'sinon-chai'],
frameworks: ['jasmine'],

plugins: [
'karma-mocha',
'karma-chai',
'karma-jasmine',
'karma-sinon-chai',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-jquery',
'karma-chai-jquery'
'karma-spec-reporter'
],

// list of files / patterns to load in the browser
Expand Down Expand Up @@ -67,11 +64,24 @@ module.exports = function(config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
browsers: ['Chrome'],


// Use a custom launcher to run Chrome on TravisCI
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});

// Switch browser to Chrome if TravisCI is detected
if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
}
};
19 changes: 17 additions & 2 deletions karma-src.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(config) {
plugins: [
'karma-jasmine',
'karma-sinon-chai',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-spec-reporter'
],

Expand Down Expand Up @@ -65,11 +65,26 @@ module.exports = function(config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
browsers: ['Chrome'],


// Use a custom launcher to run Chrome on TravisCI
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});

// Switch browser to Chrome if TravisCI is detected
if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
}
};

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
"karma-chrome-launcher": "^0.1.4",
"karma-jasmine": "^0.3.6",
"karma-jquery": "^0.1.0",
"karma-mocha": "^0.1.8",
"karma-phantomjs-launcher": "^0.1.4",
"karma-sinon-chai": "^0.2.0",
"karma-spec-reporter": "^0.0.18",
"mocha": "^1.21.4",
"run-sequence": "^1.0.2",
"sinon": "^1.10.3",
"sinon-chai": "^2.5.0"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/angular-zendesk-widget/zendeskWidgetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Angular Zendesk Widget', function() {
module('zendeskWidget');
expect(function() {
inject()
}).toThrow();
}).toThrowError('Missing accountUrl. Please set in app config via ZendeskWidgetProvider');
});

});
Expand Down