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({
+1 -1
View File
@@ -29,7 +29,6 @@
"@backstage/integration": "^1.3.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.3-next.2",
"@backstage/theme": "^0.2.15",
"@faker-js/faker": "^7.4.0",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.61",
@@ -45,6 +44,7 @@
"@backstage/core-app-api": "^1.0.5-next.0",
"@backstage/dev-utils": "^1.0.5-next.1",
"@backstage/test-utils": "^1.1.3-next.0",
"@faker-js/faker": "^7.4.0",
"@spotify/prettier-config": "^14.0.0",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",