Skip to content

Commit

Permalink
fix: scoped github client imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 16, 2020
1 parent b7a1e07 commit d6002bc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions config/rollup-named.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@
],
"node_modules/node-emoji/index.js": [
"find"
],
"node_modules/@octokit/rest/index.js": [
"Octokit"
]
}
2 changes: 1 addition & 1 deletion src/listener/GithubListener.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Octokit from '@octokit/rest';
import { Octokit } from '@octokit/rest';
import { Container, Inject } from 'noicejs';
import { Repository } from 'typeorm';

Expand Down
2 changes: 1 addition & 1 deletion src/utils/github/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { App } from '@octokit/app';
import Octokit from '@octokit/rest';
import { Octokit } from '@octokit/rest';
import { BaseOptions, Inject, Logger } from 'noicejs';

import { INJECT_LOGGER } from '../../BaseService';
Expand Down
8 changes: 4 additions & 4 deletions test/controller/github/TestCommitController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChecksListForRefResponse, ReposGetCombinedStatusForRefResponse, Response } from '@octokit/rest';
import { Octokit } from '@octokit/rest';
import { expect } from 'chai';
import { ineeda } from 'ineeda';
import { spy } from 'sinon';
Expand All @@ -19,7 +19,7 @@ const TEST_TRANSFORM = 'test-transform';

interface ClientResponse<T> {
endpoint: any;
(params: any): Promise<Response<T>>;
(params: any): Promise<Octokit.Response<T>>;
}

describeLeaks('github commit controller', async () => {
Expand All @@ -32,7 +32,7 @@ describeLeaks('github commit controller', async () => {
}),
}));

const listForRef: ClientResponse<ChecksListForRefResponse> = (params: any) => Promise.resolve({
const listForRef: ClientResponse<Octokit.ChecksListForRefResponse> = (params: any) => Promise.resolve({
[Symbol.iterator]: undefined as any,
data: {
check_runs: [],
Expand All @@ -43,7 +43,7 @@ describeLeaks('github commit controller', async () => {
});
listForRef.endpoint = undefined;

const getCombinedStatusForRef: ClientResponse<ReposGetCombinedStatusForRefResponse> = (params: any) => Promise.resolve({
const getCombinedStatusForRef: ClientResponse<Octokit.ReposGetCombinedStatusForRefResponse> = (params: any) => Promise.resolve({
[Symbol.iterator]: undefined as any,
data: {
commit_url: '',
Expand Down
2 changes: 1 addition & 1 deletion test/utils/github/TestClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { App } from '@octokit/app';
import Octokit from '@octokit/rest';
import { Octokit } from '@octokit/rest';
import { expect } from 'chai';
import { ineeda } from 'ineeda';
import { match, spy, stub } from 'sinon';
Expand Down

0 comments on commit d6002bc

Please sign in to comment.