Skip to content
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- 12
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ clean:
rm -fr build components template.js

test:
@mocha-phantomjs test/index.html
@npm test

.PHONY: clean test
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,18 @@ function parse(str) {
var obj = {};
var pairs = str.split(/ *; */);
var pair;
if ('' == pairs[0]) return obj;
var eqidx;
var name;
var value;
for (var i = 0; i < pairs.length; ++i) {
pair = pairs[i].split('=');
obj[decode(pair[0])] = decode(pair[1]);
pair = pairs[i];
eqidx = pair.indexOf("=");
if (eqidx === -1) {
eqidx = pair.length;
}
name = decode(pair.substr(0, eqidx));
value = decode(pair.substr(eqidx + 1)); // +1 because we don't want the =
obj[name] = value;
}
return obj;
}
Expand Down
78 changes: 78 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Karma configuration
// Generated on Fri Nov 01 2019 08:56:20 GMT-0400 (Eastern Daylight Time)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['browserify', 'detectBrowsers', 'mocha'],


// list of files / patterns to load in the browser
files: [
'test/tests.js'
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/tests.js': [ 'browserify' ]
},

browserify: {
debug: true
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
//browsers: ['Chrome', 'ChromeHeadless', 'Firefox', 'Safari', 'IE', 'Edge'],

detectBrowsers: {
// enable/disable, default is true
enabled: true,

// enable/disable phantomjs support, default is true
usePhantomJS: false,

// use headless mode, for browsers that support it, default is false
preferHeadless: true,
},

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

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
Loading