55 * LICENSE file in the root directory of this source tree.
66 */
77
8- import { createElement } from 'react' ;
98import { fromPartial } from '@total-typescript/shoehorn' ;
109import createSitemap from '../createSitemap' ;
1110import type { PluginOptions } from '../options' ;
@@ -39,7 +38,7 @@ describe('createSitemap', () => {
3938 const sitemap = await createSitemap ( {
4039 siteConfig,
4140 routes : routes ( [ '/' , '/test' ] ) ,
42- head : { } ,
41+ routesBuildMetadata : { } ,
4342 options,
4443 } ) ;
4544 expect ( sitemap ) . toContain (
@@ -51,7 +50,7 @@ describe('createSitemap', () => {
5150 const sitemap = await createSitemap ( {
5251 siteConfig,
5352 routes : routes ( [ ] ) ,
54- head : { } ,
53+ routesBuildMetadata : { } ,
5554 options,
5655 } ) ;
5756 expect ( sitemap ) . toBeNull ( ) ;
@@ -67,7 +66,7 @@ describe('createSitemap', () => {
6766 '/search/foo' ,
6867 '/tags/foo/bar' ,
6968 ] ) ,
70- head : { } ,
69+ routesBuildMetadata : { } ,
7170 options : {
7271 ...options ,
7372 ignorePatterns : [
@@ -94,7 +93,7 @@ describe('createSitemap', () => {
9493 '/search/foo' ,
9594 '/tags/foo/bar' ,
9695 ] ) ,
97- head : { } ,
96+ routesBuildMetadata : { } ,
9897 options : {
9998 ...options ,
10099 createSitemapItems : async ( params ) => {
@@ -119,7 +118,7 @@ describe('createSitemap', () => {
119118 const sitemap = await createSitemap ( {
120119 siteConfig,
121120 routes : routes ( [ '/' , '/docs/myDoc/' , '/blog/post' ] ) ,
122- head : { } ,
121+ routesBuildMetadata : { } ,
123122 options : {
124123 ...options ,
125124 createSitemapItems : async ( ) => {
@@ -135,7 +134,7 @@ describe('createSitemap', () => {
135134 const sitemap = await createSitemap ( {
136135 siteConfig,
137136 routes : routes ( [ '/' , '/test' , '/nested/test' , '/nested/test2/' ] ) ,
138- head : { } ,
137+ routesBuildMetadata : { } ,
139138 options,
140139 } ) ;
141140
@@ -149,7 +148,7 @@ describe('createSitemap', () => {
149148 const sitemap = await createSitemap ( {
150149 siteConfig : { ...siteConfig , trailingSlash : true } ,
151150 routes : routes ( [ '/' , '/test' , '/nested/test' , '/nested/test2/' ] ) ,
152- head : { } ,
151+ routesBuildMetadata : { } ,
153152 options,
154153 } ) ;
155154
@@ -167,7 +166,7 @@ describe('createSitemap', () => {
167166 trailingSlash : false ,
168167 } ,
169168 routes : routes ( [ '/' , '/test' , '/nested/test' , '/nested/test2/' ] ) ,
170- head : { } ,
169+ routesBuildMetadata : { } ,
171170 options,
172171 } ) ;
173172
@@ -180,19 +179,10 @@ describe('createSitemap', () => {
180179 it ( 'filters pages with noindex' , async ( ) => {
181180 const sitemap = await createSitemap ( {
182181 siteConfig,
183- routesPaths : [ '/' , '/noindex' , '/nested/test' , '/nested/test2/' ] ,
184182 routes : routes ( [ '/' , '/noindex' , '/nested/test' , '/nested/test2/' ] ) ,
185- head : {
183+ routesBuildMetadata : {
186184 '/noindex' : {
187- meta : {
188- // @ts -expect-error: bad lib def
189- toComponent : ( ) => [
190- createElement ( 'meta' , {
191- name : 'robots' ,
192- content : 'NoFolloW, NoiNDeX' ,
193- } ) ,
194- ] ,
195- } ,
185+ noIndex : true ,
196186 } ,
197187 } ,
198188 options,
@@ -204,24 +194,13 @@ describe('createSitemap', () => {
204194 it ( 'does not generate anything for all pages with noindex' , async ( ) => {
205195 const sitemap = await createSitemap ( {
206196 siteConfig,
207- routesPaths : [ '/' , '/noindex' ] ,
208197 routes : routes ( [ '/' , '/noindex' ] ) ,
209- head : {
198+ routesBuildMetadata : {
210199 '/' : {
211- meta : {
212- // @ts -expect-error: bad lib def
213- toComponent : ( ) => [
214- createElement ( 'meta' , { name : 'robots' , content : 'noindex' } ) ,
215- ] ,
216- } ,
200+ noIndex : true ,
217201 } ,
218202 '/noindex' : {
219- meta : {
220- // @ts -expect-error: bad lib def
221- toComponent : ( ) => [
222- createElement ( 'meta' , { name : 'robots' , content : 'noindex' } ) ,
223- ] ,
224- } ,
203+ noIndex : true ,
225204 } ,
226205 } ,
227206 options,
0 commit comments