File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { getEventFixtures } from "./api.js";
55import {
66 BootstrapStaticSchema ,
77 FixtureSchema ,
8+ getAllFixtures ,
89 getBootstrapStatic ,
910} from "./index.js" ;
1011
@@ -16,6 +17,13 @@ describe("api", () => {
1617 expect ( result . success ) . toBe ( true ) ;
1718 } ) ;
1819
20+ it ( "getAllFixtures" , async ( ) => {
21+ const response = await getAllFixtures ( ) ;
22+ const result = v . safeParse ( v . array ( FixtureSchema ) , response ) ;
23+
24+ expect ( result . success ) . toBe ( true ) ;
25+ } ) ;
26+
1927 it ( "getBootstrapStatic" , async ( ) => {
2028 const response = await getBootstrapStatic ( ) ;
2129 const result = v . safeParse ( BootstrapStaticSchema , response ) ;
Original file line number Diff line number Diff line change @@ -23,8 +23,16 @@ export const getEventFixtures = async ({
2323} ;
2424
2525/**
26- * Fetches the current bootstrap-static endpoint data which
27- * returns:
26+ * @returns All fixtures for every event.
27+ */
28+ export const getAllFixtures = async ( ) : Promise < Fixture [ ] > => {
29+ const response = await ofetch < Fixture [ ] > ( `${ BASE_URL } /fixtures/` ) ;
30+
31+ return response ;
32+ } ;
33+
34+ /**
35+ * Fetches the bootstrap-static endpoint data which returns:
2836 * - element_stats
2937 * - element_types
3038 * - elements
You can’t perform that action at this time.
0 commit comments