Skip to content

Commit 8159d64

Browse files
committed
test(schema-org): await setup callbacks
1 parent 8eaa4f7 commit 8159d64

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/schema-org/src/nodes/Event/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('defineEvent', () => {
9494
defineEvent({
9595
name: 'Rescheduled event',
9696
previousStartDate: [
97-
new Date(Date.UTC(2025, 0, 1)),
97+
new Date(2025, 0, 1),
9898
'2025-02-01',
9999
],
100100
offers: {
@@ -108,7 +108,7 @@ describe('defineEvent', () => {
108108
const [event] = await injectSchemaOrg(head)
109109

110110
expect(event.previousStartDate).toEqual([
111-
'2025-01-01T00:00:00.000Z',
111+
'2025-01-01',
112112
'2025-02-01',
113113
])
114114
expect(event.offers).toMatchObject({

packages/schema-org/test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function findNode<T>(unhead: unknown, id: string) {
1919
throw new Error(`Could not find Schema.org node "${id}".`)
2020
return node as T
2121
}
22-
export function useSetup(fn: (unhead: ServerUnhead<ResolvableHead>) => void, meta: Partial<MetaInput> = {}) {
22+
export async function useSetup(fn: (unhead: ServerUnhead<ResolvableHead>) => Promise<void> | void, meta: Partial<MetaInput> = {}) {
2323
const head = createHead({
2424
disableDefaults: true,
2525
plugins: [
@@ -36,6 +36,6 @@ export function useSetup(fn: (unhead: ServerUnhead<ResolvableHead>) => void, met
3636
}),
3737
],
3838
})
39-
fn(head)
39+
await fn(head)
4040
return head
4141
}

0 commit comments

Comments
 (0)