feat: faker as dev dependency + use static json as test data for the local dev

Signed-off-by: Kamil Wolny <mrwolny@gmail.com>
This commit is contained in:
Kamil Wolny
2022-08-15 12:09:37 +01:00
parent 824f8dcce0
commit f6fb510ec4
3 changed files with 1213 additions and 17 deletions
File diff suppressed because it is too large Load Diff
+3 -16
View File
@@ -22,22 +22,9 @@ import {
} from '@backstage/plugin-catalog-react';
import { gitHubIssuesPlugin, GitHubIssuesPage } from '../src';
import { GitHubIssuesApi, gitHubIssuesApiRef, IssuesByRepo } from '../src/api';
import { GitHubIssuesApi, gitHubIssuesApiRef } from '../src/api';
import { generateTestIssue } from '../src/utils';
const response: IssuesByRepo = {
backstage: {
issues: {
totalCount: 464,
edges: Array.from(Array(40)).map(() =>
generateTestIssue({
repository: { nameWithOwner: 'backstage/backstage' },
}),
),
},
},
};
import testData from './__fixtures__/component-issues-data.json';
createDevApp()
.registerPlugin(gitHubIssuesPlugin)
@@ -46,7 +33,7 @@ createDevApp()
deps: {},
factory: () =>
({
fetchIssuesByRepoFromGitHub: async () => response,
fetchIssuesByRepoFromGitHub: async () => testData,
} as GitHubIssuesApi),
})
.registerApi({