aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fixtures/github-repos.fixture.ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-06 18:20:54 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-07 19:12:11 +0100
commitb8eb008dd5927fb736e56699637f5f8549965eae (patch)
tree648274babea3d3d09ed3e0f5f1fef013f94158fb /tests/fixtures/github-repos.fixture.ts
parent802285872a2c57e7a5e130f32a2b45497d7687f1 (diff)
refactor(hooks): replace useGithubApi with useGithubRepoMeta
* use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW
Diffstat (limited to 'tests/fixtures/github-repos.fixture.ts')
-rw-r--r--tests/fixtures/github-repos.fixture.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/fixtures/github-repos.fixture.ts b/tests/fixtures/github-repos.fixture.ts
new file mode 100644
index 0000000..5eaa1ce
--- /dev/null
+++ b/tests/fixtures/github-repos.fixture.ts
@@ -0,0 +1,30 @@
+import type { GithubRepositoryMeta } from '../../src/types';
+
+type GithubRepository = GithubRepositoryMeta & {
+ name: string;
+ owner: string;
+};
+
+export const githubRepos = [
+ {
+ createdAt: '2020-09-26',
+ name: 'laborum',
+ owner: 'Dion',
+ stargazerCount: 8,
+ updatedAt: '2023-05-05',
+ },
+ {
+ createdAt: '2020-10-30',
+ name: 'quo',
+ owner: 'Brennan',
+ stargazerCount: 0,
+ updatedAt: '2022-03-01',
+ },
+ {
+ createdAt: '2021-11-16',
+ name: 'soluta',
+ owner: 'Alex',
+ stargazerCount: 8,
+ updatedAt: '2023-08-10',
+ },
+] satisfies GithubRepository[];