Skip to content

Commit

Permalink
fix: remote ctor takes options, stub tests for main
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Aug 12, 2020
1 parent c1394f3 commit c2d54aa
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export async function main(argv: Array<string>): Promise<number> {

// create logger
// create remote
const remote = new GithubRemote();
const remote = new GithubRemote({
data: {},
type: '',
});

// mode switch
const options: SyncOptions = {
Expand Down
7 changes: 6 additions & 1 deletion src/remote/github.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { NotImplementedError } from '@apextoaster/js-utils';

import { IssueUpdate, LabelUpdate, Remote } from '.';
import { IssueUpdate, LabelUpdate, Remote, RemoteOptions } from '.';

/**
* Github/Octokit API implementation of the `Remote` contract.
*/
export class GithubRemote implements Remote {
/* eslint-disable-next-line no-useless-constructor */
constructor(options: RemoteOptions) {
// TODO: set up octokit API
}

public async createComment() {
throw new NotImplementedError();
}
Expand Down
7 changes: 6 additions & 1 deletion src/remote/gitlab.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { NotImplementedError } from '@apextoaster/js-utils';

import { IssueUpdate, LabelUpdate, Remote } from '.';
import { IssueUpdate, LabelUpdate, Remote, RemoteOptions } from '.';

/**
* Gitlab API implementation of the `Remote` contract.
*/
export class GitlabRemote implements Remote {
/* eslint-disable-next-line no-useless-constructor */
constructor(options: RemoteOptions) {
// TODO: set up gitlab API
}

public async createComment() {
throw new NotImplementedError();
}
Expand Down
6 changes: 6 additions & 0 deletions test/TestMain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe('main app', () => {
it('should parse command line arguments');
it('should load config from file');
it('should create a remote');
it('should fail on errors');
});

0 comments on commit c2d54aa

Please sign in to comment.