Use Phantom for testing

This commit is contained in:
Josh Johnson 2016-07-02 13:50:24 +01:00
parent a54edafef5
commit c8337f3f67
3 changed files with 6 additions and 5 deletions

View file

@ -117,7 +117,7 @@ export class Choices {
if (!cuttingTheMustard) console.error('Choices: Your browser doesn\'t support Choices');
// Input type check
const canInit = this.passedElement && isElement(this.passedElement) && ['select-one', 'select-multiple', 'text'].includes(this.passedElement.type);
const canInit = this.passedElement && isElement(this.passedElement) && ['select-one', 'select-multiple', 'text'].some(type => type === this.passedElement.type);
if(canInit) {
// If element has already been initalised with Choices
@ -1434,7 +1434,7 @@ export class Choices {
this.itemList.innerHTML = '';
// If we have items to add
if(itemListFragment.children.length) {
if(itemListFragment.children && itemListFragment.children.length) {
// Update list
this.itemList.appendChild(itemListFragment);
}

View file

@ -37,9 +37,10 @@
"fuse.js": "^2.2.0",
"jasmine-core": "^2.4.1",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-es6-shim": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.1",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "^1.7.0",
"node-sass": "^3.4.2",

View file

@ -6,8 +6,8 @@ module.exports = function(config) {
files: [
'../tests/**/*_spec.js',
],
plugins: [webpack, 'karma-jasmine', 'karma-chrome-launcher', 'karma-coverage', 'karma-spec-reporter'],
browsers: ['Chrome'],
plugins: [webpack, 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage', 'karma-spec-reporter', 'es6-shim'],
browsers: ['PhantomJS'],
preprocessors: {
'**/*_spec.js': ['webpack'],
'src/**/*.js': ['webpack']