Skip to content

Fix tests #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mocha.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--compilers js:babel-register
--timeout 15000
--timeout 20000
--slow 5000
2 changes: 1 addition & 1 deletion test/auth.spec.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion test/fixtures/repos-ratelimit-exhausted.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import nock from 'nock';
export default function fixture() {
let scope;
scope = nock('https://api.github.com:443', {"encodedQueryParams":true})
.get('/users/mikedeboertest/repos')
.get('/users/github-tools-test/repos')
.query({"type":"all","sort":"updated","per_page":"100"})
.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',
date: 'Sat, 18 Jun 2016 11:50:00 GMT',
Expand Down
97 changes: 95 additions & 2 deletions test/fixtures/repos-ratelimit-ok.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions test/fixtures/user.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
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