Skip to content
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
selmertsx committed Feb 7, 2018
1 parent 6357a16 commit e2c7074
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# NOTE:
# write down tslint settings to this document.
# https://prettier.io/docs/en/options.html
#
6 changes: 3 additions & 3 deletions __tests__/github.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GitHub } from '../src/github'
import { GitHub } from "../src/github";

describe('pullRequests', () => {
it('get', () => {
describe("pullRequests", () => {
it("get", () => {
const url = "https://github.com/selmertsx/serverless-prpolice";
const github = new GitHub();
github.authenticate();
Expand Down
34 changes: 14 additions & 20 deletions src/github.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
import GitHubApi from 'github';
import { resolve } from 'dns';
import GitHubApi from "@octokit/rest";
import { resolve } from "dns";

export class GitHub {
_github: any;
private readonly github: any;

constructor(){
this._github = new GitHubApi()
constructor() {
this.github = new GitHubApi();
}

authenticate(){
this._github.authenticate({
type: 'token',
public authenticate() {
this.github.authenticate({
type: "token",
token: process.env.TOKEN
})
});
}

pullRequests(){
return this._github.pullRequests.getAll({
owner: 'selmertsx',
repo: 'serverless-prpolice'
})
public pullRequests() {
return this.github.pullRequests.getAll({
owner: "selmertsx",
repo: "serverless-prpolice"
});
}
}


const github = new GitHub();
github.pullRequests().then((results) => {
console.log(results);
});
2 changes: 1 addition & 1 deletion src/pull_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export class PullRequest {
private readonly github: any;
private readonly repository: string;

constructor(github, repository){
constructor(github, repository) {
this.github = github;
this.repository = repository;
}
Expand Down

0 comments on commit e2c7074

Please sign in to comment.