Skip to content

Commit 24a687d

Browse files
committed
Travis integration, browser tests
This commit is unfortunately quite massive, because it snowballed. Here's what's new: - Support for HTMLCollection (will be published as 1.1.1) - Travis CI integration - Browser tests (also ran on Sauce Labs on Travis) - Remove .npmignore and specify whitelist of package files in package.json
1 parent bbb302e commit 24a687d

20 files changed

+4693
-12
lines changed

.eslintrc.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
plugins: [
3+
'webdriverio'
4+
],
5+
env: {
6+
browser: true,
7+
commonjs: true,
8+
es6: true,
9+
'webdriverio/wdio': true,
10+
mocha: true
11+
},
12+
parserOptions: {
13+
ecmaVersion: 2017
14+
},
15+
extends: 'eslint:recommended',
16+
rules: {
17+
indent: [
18+
'error',
19+
4
20+
],
21+
'linebreak-style': [
22+
'error',
23+
'unix'
24+
],
25+
quotes: [
26+
'error',
27+
'single'
28+
],
29+
semi: [
30+
'error',
31+
'always'
32+
]
33+
}
34+
};

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "8"
4+
5+
script: npm test
6+
7+
notifications:
8+
email: false

build/smart-number-inputs.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
1313

14-
;(function (factory) {
14+
/* global define */
15+
(function (factory) {
1516
if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && (typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object') {
1617
module.exports = factory();
1718
} else if (typeof define === 'function' && define.amd) {
@@ -73,7 +74,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
7374
};
7475

7576
var enable = function enable(element) {
76-
if (isArray(element) || element instanceof NodeList) {
77+
if (isArray(element) || element instanceof NodeList || element instanceof HTMLCollection) {
7778
return forEach(element, enable);
7879
}
7980

@@ -97,7 +98,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9798

9899
if (character >= start) {
99100
if (newStart === null) newStart = character - originalValue.length;
100-
segments[i] = originalValue.replace(/\-?[0-9]+/, parseInt(originalValue.replace(/^.*?(\-?[0-9]+).*/, '$1'), 10) + addition);
101+
segments[i] = originalValue.replace(/-?[0-9]+/, parseInt(originalValue.replace(/^.*?(-?[0-9]+).*/, '$1'), 10) + addition);
101102
}
102103

103104
character -= originalValue.length - segments[i].length;

build/smart-number-inputs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.1.2
4+
5+
- Support for `HTMLCollection`.
6+
37
## 1.1.0
48

59
- Support for delimiters such as ":".

0 commit comments

Comments
 (0)