Skip to content

Commit

Permalink
fix(test): use container for remotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Aug 22, 2020
1 parent d78e5df commit 545e5b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface ProjectConfig {
/**
* Remote APIs.
*/
remote: RemoteOptions;
remote: Omit<RemoteOptions, 'container'>;

/**
* Grouped state labels.
Expand Down
3 changes: 1 addition & 2 deletions test/sync/TestSyncIssues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ describe('issue sync', () => {

const logger = NullLogger.global;
const remoteData = {
container,
data: {},
dryrun: true,
logger,
type: '',
};
const remote = new GithubRemote(remoteData);
const remote = await container.create(GithubRemote, remoteData);
const listStub = stub(remote, 'listIssues').returns(Promise.resolve([{
issue: '',
labels: ['nope'],
Expand Down
9 changes: 3 additions & 6 deletions test/sync/TestSyncProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ describe('project sync', () => {
name: 'test',
});
const remoteConfig = {
container,
data: {},
dryrun: true,
logger,
type: '',
};
const remote = new GithubRemote(remoteConfig);
const remote = await container.create(GithubRemote, remoteConfig);
const updateSpy = spy(remote, 'updateLabel');

await syncSingleLabel({
Expand Down Expand Up @@ -71,13 +70,12 @@ describe('project sync', () => {
name: 'test',
});
const remoteConfig = {
container,
data: {},
dryrun: true,
logger,
type: '',
};
const remote = new GithubRemote(remoteConfig);
const remote = await container.create(GithubRemote, remoteConfig);
const createStub = stub(remote, 'createLabel');
const deleteStub = stub(remote, 'deleteLabel');
const listStub = stub(remote, 'listLabels').returns(Promise.resolve([]));
Expand Down Expand Up @@ -117,13 +115,12 @@ describe('project sync', () => {
name: 'test',
});
const remoteConfig = {
container,
data: {},
dryrun: true,
logger,
type: '',
};
const remote = new GithubRemote(remoteConfig);
const remote = await container.create(GithubRemote, remoteConfig);
const createStub = stub(remote, 'createLabel');
const deleteStub = stub(remote, 'deleteLabel');
const listStub = stub(remote, 'listLabels').returns(Promise.resolve([{
Expand Down

0 comments on commit 545e5b9

Please sign in to comment.