Skip to content

Commit 823ad56

Browse files
committed
Updates integration tests to not run locally
Since the repo doesn't contain auth.js by default, this re-arranges the integration test file to not run if the file isn't present, which should make it easier for new developers to get up and running: Rather than needing to always comment out the integration test file, the project will just work.
1 parent 4d07c22 commit 823ad56

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ If you want to contribute to the repository, follow these steps:
2828

2929
1. Fork the repo.
3030
1. Develop and test your code changes: `npm install -d && npm test`. Make sure you work in the `dev` branch. PLEASE don't do your work in `master`.
31-
1. In order to run the tests locally you should comment out `test.integration-all-services.js` because the integration tests require you to have service credentials for all the services.
32-
Travis will run the integration tests for all services once the changes are merged in.
31+
1. Travis-CI will run the integration tests for all services once your changes are merged.
32+
If you wish to run integration tests locally you must provide service credentials for all the services. See `test/test.integration-all-services.js`.
3333
1. Add a test for your changes. Only refactoring and documentation changes require no new tests.
3434
1. Make the test pass.
3535
1. Commit your changes.

test/test.integration-all-services.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
'use strict';
22

3+
var fs = require('fs');
4+
5+
if (fs.existsSync(__dirname + '/resources/auth.js')) {
6+
37
var nock = require('nock');
48
var watson = require('../lib/index');
59
var auth = require('./resources/auth');
6-
var fs = require('fs');
710
var assert = require('assert');
811

912
var mobydick = fs.readFileSync(__dirname + '/resources/mobydick.txt', 'utf8');
@@ -14,8 +17,6 @@ var TEN_SECONDS = 10000;
1417
var FIVE_SECONDS = 5000;
1518
var TWO_SECONDS = 2000;
1619

17-
if (fs.existsSync(__dirname + '/resources/auth.js')) {
18-
1920
describe('integration-all-services', function() {
2021

2122
this.slow(TWO_SECONDS); // this controls when the tests get a colored warning for taking too long

0 commit comments

Comments
 (0)