@@ -22,12 +22,27 @@ test.afterEach(async (t) => {
2222
2323// Test relative and absolute paths
2424const CONFIGS = [
25- { distPath : './fixtures' , testNamePostfix : 'relative path' , cwd : __dirname } ,
26- { distPath : path . resolve ( __dirname , './fixtures' ) , testNamePostfix : 'absolute path' } ,
25+ {
26+ distPath : './fixtures' ,
27+ testNamePostfix : 'relative path' ,
28+ cwd : __dirname ,
29+ excludePath : './fixtures/children/grandchildren/grandchild-two.html' ,
30+ } ,
31+ {
32+ distPath : path . resolve ( __dirname , './fixtures' ) ,
33+ testNamePostfix : 'absolute path' ,
34+ excludePath : path . resolve ( __dirname , './fixtures/children/grandchildren/grandchild-two.html' ) ,
35+ } ,
36+ {
37+ distPath : '.' ,
38+ testNamePostfix : 'root relative path' ,
39+ cwd : path . join ( __dirname , 'fixtures' ) ,
40+ excludePath : './children/grandchildren/grandchild-two.html' ,
41+ } ,
2742]
2843
2944// eslint-disable-next-line max-lines-per-function
30- CONFIGS . forEach ( ( { distPath, testNamePostfix, cwd } ) => {
45+ CONFIGS . forEach ( ( { distPath, testNamePostfix, cwd, excludePath } ) => {
3146 test ( `Creates Sitemap with all html files - ${ testNamePostfix } ` , async ( t ) => {
3247 const { fileName } = t . context
3348 const sitemapData = await makeSitemap ( {
@@ -143,8 +158,6 @@ CONFIGS.forEach(({ distPath, testNamePostfix, cwd }) => {
143158
144159 test ( `Sitemap exclude works correctly - ${ testNamePostfix } ` , async ( t ) => {
145160 const { fileName } = t . context
146- const toExclude = './fixtures/children/grandchildren/grandchild-two.html'
147- const excludePath = cwd === undefined ? path . resolve ( __dirname , toExclude ) : toExclude
148161 const sitemapData = await makeSitemap ( {
149162 homepage : 'https://site.com/' ,
150163 distPath,
0 commit comments