Skip to content

Commit 141d2c5

Browse files
authored
Merge pull request #228 from web-push-libs/drop_node_0.10_0.12
Drop support for Node.js <= 0.12
2 parents c1c4b34 + ccae61c commit 141d2c5

File tree

9 files changed

+262
-346
lines changed

9 files changed

+262
-346
lines changed

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ coverage
22
test
33
test_tools
44
.travis.yml
5-
wires
65
.eslintrc

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ env:
1515
- DISPLAY=$(if [[ $TRAVIS_OS_NAME == "linux" ]]; then echo ':99.0'; fi)
1616
- MOZ_XVFB=$(if [[ $TRAVIS_OS_NAME == "linux" ]]; then echo 1; fi)
1717
matrix:
18-
- NODE_VERSION="0.10"
19-
- NODE_VERSION="0.12"
2018
- NODE_VERSION="4"
2119
- NODE_VERSION="stable"
2220
before_install:
@@ -32,6 +30,5 @@ install:
3230
before_script:
3331
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi
3432
script:
35-
- if [[ $NODE_VERSION != "0.10" && $NODE_VERSION != "0.12" ]]; then $NPM run lint; fi
3633
- $NPM test
3734
sudo: required

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"download-browser": "node --harmony ./test/helpers/download-test-browsers.js",
1111
"lint": "node ./node_modules/eslint/bin/eslint --ignore-path .gitignore '.'",
12-
"pretest": "npm run download-browser",
12+
"pretest": "npm run lint && npm run download-browser",
1313
"test": "node --harmony node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- --ui tdd test/test*"
1414
},
1515
"repository": {
@@ -29,12 +29,7 @@
2929
},
3030
"homepage": "https://github.com/marco-c/web-push#readme",
3131
"dependencies": {
32-
"array.prototype.find": "^2.0.0",
3332
"asn1.js": "^4.8.1",
34-
"bluebird": "^3.3.5",
35-
"buffer-compare-shim": "^1.0.0",
36-
"buffer-equals-polyfill": "^1.0.0",
37-
"create-ecdh": "^4.0.0",
3833
"http_ece": "^0.5.1",
3934
"jws": "^3.1.3",
4035
"minimist": "^1.2.0",
@@ -62,6 +57,6 @@
6257
"which": "^1.2.11"
6358
},
6459
"engines": {
65-
"node": ">= v0.10.0"
60+
"node": ">= 4"
6661
}
6762
}

src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
'use strict';
22

3-
// This loads up shims required for older versions of node.
4-
require('./shim');
5-
63
const vapidHelper = require('./vapid-helper.js');
74
const encryptionHelper = require('./encryption-helper.js');
85
const WebPushLib = require('./web-push-lib.js');

src/shim.js

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
11
'use strict';
22

3-
(function() {
4-
const invalidNodeVersions = /0.(10|12).(\d+)/;
5-
if (process.versions.node.match(invalidNodeVersions)) {
6-
console.log('Skipping downloading browsers as selenium tests can\'t run on ' + process.versions.node);
7-
return null;
8-
}
3+
const seleniumAssistant = require('selenium-assistant');
94

10-
/* eslint-disable global-require*/
11-
const seleniumAssistant = require('selenium-assistant');
12-
/* eslint-enable global-require*/
5+
let forceDownload = false;
6+
if (process.env.TRAVIS) {
7+
forceDownload = true;
8+
}
139

14-
let forceDownload = false;
15-
if (process.env.TRAVIS) {
16-
forceDownload = true;
17-
}
10+
const promises = [
11+
seleniumAssistant.downloadBrowser('firefox', 'stable', forceDownload),
12+
seleniumAssistant.downloadBrowser('firefox', 'beta', forceDownload),
13+
seleniumAssistant.downloadBrowser('firefox', 'unstable', forceDownload),
14+
seleniumAssistant.downloadBrowser('chrome', 'stable', forceDownload),
15+
seleniumAssistant.downloadBrowser('chrome', 'beta', forceDownload),
16+
seleniumAssistant.downloadBrowser('chrome', 'unstable', forceDownload)
17+
];
1818

19-
const promises = [
20-
seleniumAssistant.downloadBrowser('firefox', 'stable', forceDownload),
21-
seleniumAssistant.downloadBrowser('firefox', 'beta', forceDownload),
22-
seleniumAssistant.downloadBrowser('firefox', 'unstable', forceDownload),
23-
seleniumAssistant.downloadBrowser('chrome', 'stable', forceDownload),
24-
seleniumAssistant.downloadBrowser('chrome', 'beta', forceDownload),
25-
seleniumAssistant.downloadBrowser('chrome', 'unstable', forceDownload)
26-
];
27-
28-
return Promise.all(promises)
29-
.then(function() {
30-
console.log('Download complete.');
31-
})
32-
.catch(function(err) {
33-
console.error('Unable to download browsers.', err);
34-
process.exit(1);
35-
});
36-
})();
19+
Promise.all(promises)
20+
.then(function() {
21+
console.log('Download complete.');
22+
})
23+
.catch(function(err) {
24+
console.error('Unable to download browsers.', err);
25+
process.exit(1);
26+
});

test/helpers/port-open.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)