Skip to content

Commit 1ba01ed

Browse files
authored
Merge pull request github-tools#571 from github-tools/fix-tests
Fix tests
2 parents edf3270 + 5ab10bc commit 1ba01ed

18 files changed

+125
-26
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/repos-ratelimit-exhausted.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import nock from 'nock';
33
export default function fixture() {
44
let scope;
55
scope = nock('https://api.github.com:443', {"encodedQueryParams":true})
6-
.get('/users/mikedeboertest/repos')
6+
.get('/users/github-tools-test/repos')
77
.query({"type":"all","sort":"updated","per_page":"100"})
88
.reply(403, {"message":"API rate limit exceeded for 174.20.8.171. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}, { server: 'GitHub.com',
99
date: 'Sat, 18 Jun 2016 11:50:00 GMT',

test/fixtures/repos-ratelimit-ok.js

Lines changed: 95 additions & 2 deletions
Large diffs are not rendered by default.

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 jaredrewerts@gmail.com 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';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy