Skip to content

Commit

Permalink
Switched to injecting user via environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rewerts committed Jun 17, 2019
1 parent 6592189 commit 5ab10bc
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion mocha.opts
@@ -1,3 +1,3 @@
--compilers js:babel-register
--timeout 15000
--timeout 20000
--slow 5000
2 changes: 1 addition & 1 deletion test/auth.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful, assertFailure} from './helpers/callbacks';

describe('Github', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/error.spec.js
Expand Up @@ -3,7 +3,7 @@ import expect from 'must';
import nock from 'nock';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful, assertFailure} from './helpers/callbacks';
import fixtureExhausted from './fixtures/repos-ratelimit-exhausted.js';
import fixtureOk from './fixtures/repos-ratelimit-ok.js';
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/record.js
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import nock from 'nock';
import path from 'path';
import GitHub from '../../lib/GitHub';
import testUser from './user.json';
import testUser from './user.js';

const gh = new GitHub();

Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/user.js
@@ -0,0 +1,13 @@
let user;

if (process.env.GHTOOLS_USER) {
user = {
'USERNAME': process.env.GHTOOLS_USER,
'PASSWORD': process.env.GHTOOLS_PASSWORD,
'REPO': 'github',
'ORGANIZATION': 'github-api-tests',
};
} else {
throw new Error('No testing account set up. Please email jaredrewerts@gmail.com to get access.');
}
export default user;
6 changes: 0 additions & 6 deletions test/fixtures/user.json

This file was deleted.

4 changes: 2 additions & 2 deletions test/gist.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import testGist from './fixtures/gist.json';
import {assertSuccessful} from './helpers/callbacks';

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

describe('reading', function() {
before(function() {
gist = github.getGist('f1c0f84e53aa6b98ec03');
gist = github.getGist('0ac3ef3451f4bdc9efec660ffce3e336');
});

it('should read a gist', function(done) {
Expand Down
2 changes: 1 addition & 1 deletion test/issue.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import wait from './helpers/wait';
import {assertSuccessful} from './helpers/callbacks';
import getTestRepoName from './helpers/getTestRepoName';
Expand Down
2 changes: 1 addition & 1 deletion test/markdown.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';

describe('Markdown', function() {
let github;
Expand Down
2 changes: 1 addition & 1 deletion test/organization.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful, assertArray} from './helpers/callbacks';
import getTestRepoName from './helpers/getTestRepoName';

Expand Down
2 changes: 1 addition & 1 deletion test/project.spec.js
Expand Up @@ -2,7 +2,7 @@ import expect from 'must';

import Github from '../lib/GitHub';
import wait from './helpers/wait';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful} from './helpers/callbacks';
import getTestRepoName from './helpers/getTestRepoName';

Expand Down
2 changes: 1 addition & 1 deletion test/rate-limit.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful} from './helpers/callbacks';

describe('RateLimit', function() {
Expand Down
5 changes: 2 additions & 3 deletions test/repository.spec.js
Expand Up @@ -2,7 +2,7 @@ import expect from 'must';

import Github from '../lib/GitHub';
import wait from './helpers/wait';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import loadImage from './fixtures/imageBlob';
import {assertSuccessful, assertFailure} from './helpers/callbacks';
import getTestRepoName from './helpers/getTestRepoName';
Expand Down Expand Up @@ -626,8 +626,7 @@ describe('Repository', function() {
treeSHA = commit.data.tree.sha;
return remoteRepo.commit(parentSHA, treeSHA, 'is this thing on?');
}).then((commit) => {
expect(commit.data.author).to.have.own('name', 'Mike de Boer');
expect(commit.data.author).to.have.own('email', 'mike@c9.io');
expect(commit.data.author).to.have.own('name', 'github-tools-test');
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/search.spec.js
Expand Up @@ -2,7 +2,7 @@ import expect from 'must';
import nock from 'nock';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';

describe('Search', function() {
this.timeout(20 * 1000); // eslint-disable-line no-invalid-this
Expand Down
2 changes: 1 addition & 1 deletion test/team.spec.js
@@ -1,7 +1,7 @@
import expect from 'must';

import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertFailure} from './helpers/callbacks';
import getTestRepoName from './helpers/getTestRepoName';

Expand Down
2 changes: 1 addition & 1 deletion test/user.spec.js
@@ -1,5 +1,5 @@
import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import testUser from './fixtures/user.js';
import {assertSuccessful, assertArray} from './helpers/callbacks';

describe('User', function() {
Expand Down

0 comments on commit 5ab10bc

Please sign in to comment.