I have a some complex data processing going on in my MetaFunction that I want to unit test:
export const meta: MetaFunction<{
data: { pageContent: { title: string; seo: SEOFields } };
}> = ({ data }) => {
// logic here
}
as you can see I'm trying to type the parameter of meta() so I can use a more simple type in my unit test:
const data = {
pageContent: {
title: `Page Title`,
seo: {
seo_title: `SEO Title`,
meta_description: `Meta Description`,
enable_search_indexing: true,
enable_search_following: true,
opengraph_metadata: {
title: `OG Title`,
description: `OG Description`,
},
twitter_metadata: {
title: `Twitter Title`,
description: `Twitter Description`,
},
},
},
};
const metaData = meta({ data });
however I get this type error: