Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Apr 1, 2020
1 parent 12d6626 commit 6230784
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/services/github/fetchCommitsByAuthor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getExistingBackportPRs,
} from './fetchCommitsByAuthor';
import { commitsWithPullRequestsMock } from './mocks/commitsByAuthorMock';
import { getExistingBackportPRsMock } from './mocks/getExistingBackportPRsMock';
import { getCommitsByAuthorMock } from './mocks/getCommitsByAuthorMock';
import { getDefaultOptions } from '../../test/getDefaultOptions';
import axios from 'axios';
import { getPullRequestEdgeMock } from './mocks/getPullRequestEdgeMock';
Expand Down Expand Up @@ -185,11 +185,11 @@ async function getExistingBackportsByRepoName(
repoName1: string,
repoName2: string
) {
const existingPrsMock = getExistingBackportPRsMock(repoName1);
const commitsMock = getCommitsByAuthorMock(repoName1);

spyOn(axios, 'post').and.returnValues(
{ data: { data: currentUserMock } },
{ data: { data: existingPrsMock } }
{ data: { data: commitsMock } }
);

const options = getDefaultOptions({
Expand Down
2 changes: 1 addition & 1 deletion src/services/github/mocks/getCommitsByAuthorMock.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataResponse } from '../fetchCommitsByAuthor';

export const getExistingBackportPRsMock = (repoName: string): DataResponse => ({
export const getCommitsByAuthorMock = (repoName: string): DataResponse => ({
repository: {
ref: {
target: {
Expand Down

0 comments on commit 6230784

Please sign in to comment.