Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ab10bc

Browse files
committed
Switched to injecting user via environment variables.
1 parent 6592189 commit 5ab10bc

16 files changed

+29
-23
lines changed

mocha.opts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--compilers js:babel-register
2-
--timeout 15000
2+
--timeout 20000
33
--slow 5000

test/auth.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'must';
22

33
import Github from '../lib/GitHub';
4-
import testUser from './fixtures/user.json';
4+
import testUser from './fixtures/user.js';
55
import {assertSuccessful, assertFailure} from './helpers/callbacks';
66

77
describe('Github', function() {

test/error.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import expect from 'must';
33
import nock from 'nock';
44

55
import Github from '../lib/GitHub';
6-
import testUser from './fixtures/user.json';
6+
import testUser from './fixtures/user.js';
77
import {assertSuccessful, assertFailure} from './helpers/callbacks';
88
import fixtureExhausted from './fixtures/repos-ratelimit-exhausted.js';
99
import fixtureOk from './fixtures/repos-ratelimit-ok.js';

test/fixtures/record.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import nock from 'nock';
33
import path from 'path';
44
import GitHub from '../../lib/GitHub';
5-
import testUser from './user.json';
5+
import testUser from './user.js';
66

77
const gh = new GitHub();
88

test/fixtures/user.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
let user;
2+
3+
if (process.env.GHTOOLS_USER) {
4+
user = {
5+
'USERNAME': process.env.GHTOOLS_USER,
6+
'PASSWORD': process.env.GHTOOLS_PASSWORD,
7+
'REPO': 'github',
8+
'ORGANIZATION': 'github-api-tests',
9+
};
10+
} else {
11+
throw new Error('No testing account set up. Please email [email protected] to get access.');
12+
}
13+
export default user;

test/fixtures/user.json

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

test/gist.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'must';
22

33
import Github from '../lib/GitHub';
4-
import testUser from './fixtures/user.json';
4+
import testUser from './fixtures/user.js';
55
import testGist from './fixtures/gist.json';
66
import {assertSuccessful} from './helpers/callbacks';
77

@@ -22,7 +22,7 @@ describe('Gist', function() {
2222

2323
describe('reading', function() {
2424
before(function() {
25-
gist = github.getGist('f1c0f84e53aa6b98ec03');
25+
gist = github.getGist('0ac3ef3451f4bdc9efec660ffce3e336');
2626
});
2727

2828
it('should read a gist', function(done) {

test/issue.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'must';
22

33
import Github from '../lib/GitHub';
4-
import testUser from './fixtures/user.json';
4+
import testUser from './fixtures/user.js';
55
import wait from './helpers/wait';
66
import {assertSuccessful} from './helpers/callbacks';
77
import getTestRepoName from './helpers/getTestRepoName';

test/markdown.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'must';
22

33
import Github from '../lib/GitHub';
4-
import testUser from './fixtures/user.json';
4+
import testUser from './fixtures/user.js';
55

66
describe('Markdown', function() {
77
let github;

test/organization.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'must';
22

33
import Github from '../lib/GitHub';
4-
import testUser from './fixtures/user.json';
4+
import testUser from './fixtures/user.js';
55
import {assertSuccessful, assertArray} from './helpers/callbacks';
66
import getTestRepoName from './helpers/getTestRepoName';
77

0 commit comments

Comments
 (0)