Skip to content

Commit 5728682

Browse files
committed
build: fix travis script, stop testing node 4
1 parent bccf770 commit 5728682

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 4
54
- 6
65
- 8
76
before_install:
@@ -11,8 +10,11 @@ before_install:
1110
- npm install -g typescript
1211
script:
1312
- tsc
14-
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test-travis; fi
15-
- if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then npm run test-unit; fi
13+
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ];
14+
then npm run test-travis;
15+
else
16+
npm run test-unit;
17+
fi
1618
- sh scripts/typedoc/generate_typedoc.sh
1719
after_success:
1820
- npm run report-coverage

lib/base_service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import bufferFrom = require('buffer-from');
2020
import extend = require('extend');
2121
import request = require('request');
22+
import semver = require('semver');
2223
import vcapServices = require('vcap_services');
2324
import { IamTokenManagerV1 } from '../iam-token-manager/v1';
2425
import { stripTrailingSlash } from './helper';
@@ -120,6 +121,10 @@ export class BaseService {
120121
'the "new" keyword is required to create Watson service instances'
121122
);
122123
}
124+
const isNodeFour = semver.satisfies(process.version, '4.x')
125+
if (isNodeFour) {
126+
console.warn('WARNING: Support for Node v4.x is deprecated and will no longer be tested. Support will be officially dropped in the next major version.');
127+
}
123128
const options = extend({}, userOptions);
124129
const _options = this.initCredentials(options);
125130
// If url is not specified, visual recognition requires gateway-a for CF instances

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"object.omit": "~3.0.0",
9595
"object.pick": "~1.3.0",
9696
"request": "~2.87.0",
97+
"semver": "^5.6.0",
9798
"vcap_services": "~0.3.4",
9899
"websocket": "~1.0.26"
99100
},

0 commit comments

Comments
 (0)