Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Mar 1, 2022
1 parent b7fcc11 commit 15fe032
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
10 changes: 7 additions & 3 deletions packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,10 @@ function getOutFolder(astroConfig: AstroConfig, pathname: string, routeType: Rou
switch (astroConfig.buildOptions.pageUrlFormat) {
case 'directory':
return new URL('.' + appendForwardSlash(pathname), outRoot);
case 'file':
case 'file': {
return new URL('.' + appendForwardSlash(npath.dirname(pathname)), outRoot);
}

}
}
}
Expand All @@ -495,8 +497,10 @@ function getOutFile(astroConfig: AstroConfig, outFolder: URL, pathname: string,
switch (astroConfig.buildOptions.pageUrlFormat) {
case 'directory':
return new URL('./index.html', outFolder);
case 'file':
return new URL('./' + npath.basename(pathname) + '.html', outFolder);
case 'file': {
const baseName = npath.basename(pathname);
return new URL('./' + (baseName || 'index') + '.html', outFolder);
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/astro-pagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe('Pagination', () => {
buildOptions: {
site: 'https://mysite.dev/blog/',
sitemap: false,
legacyBuild: true,
},
});
await fixture.build();
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/astro-sitemap-rss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('Sitemaps served from subdirectory', () => {
buildOptions: {
site: 'https://astro.build/base-directory/',
sitemap: true,
legacyBuild: true
},
});
await fixture.build();
Expand Down
3 changes: 0 additions & 3 deletions packages/astro/test/lit-element.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ describe('LitElement test', function () {
fixture = await loadFixture({
projectRoot: './fixtures/lit-element/',
renderers: ['@astrojs/renderer-lit'],
buildOptions: {
legacyBuild: true
}
});
await fixture.build();
});
Expand Down
7 changes: 0 additions & 7 deletions packages/astro/test/preview-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('Preview Routing', () => {
trailingSlash: 'never',
port: 4000,
},
buildOptions: { legacyBuild: true } // TODO make this test work without legacyBuild
});
await fixture.build();
previewServer = await fixture.preview();
Expand Down Expand Up @@ -71,7 +70,6 @@ describe('Preview Routing', () => {
trailingSlash: 'always',
port: 4001,
},
buildOptions: { legacyBuild: true } // TODO make this test work without legacyBuild
});
await fixture.build();
previewServer = await fixture.preview();
Expand Down Expand Up @@ -130,7 +128,6 @@ describe('Preview Routing', () => {
trailingSlash: 'ignore',
port: 4002,
},
buildOptions: { legacyBuild: true } // TODO make this test work without legacyBuild
});
await fixture.build();
previewServer = await fixture.preview();
Expand Down Expand Up @@ -189,7 +186,6 @@ describe('Preview Routing', () => {
projectRoot: './fixtures/with-subpath-no-trailing-slash/',
buildOptions: {
pageUrlFormat: 'file',
legacyBuild: true
},
devOptions: {
trailingSlash: 'never',
Expand Down Expand Up @@ -247,7 +243,6 @@ describe('Preview Routing', () => {
projectRoot: './fixtures/with-subpath-no-trailing-slash/',
buildOptions: {
pageUrlFormat: 'file',
legacyBuild: true
},
devOptions: {
trailingSlash: 'always',
Expand Down Expand Up @@ -309,7 +304,6 @@ describe('Preview Routing', () => {
projectRoot: './fixtures/with-subpath-no-trailing-slash/',
buildOptions: {
pageUrlFormat: 'file',
legacyBuild: true
},
devOptions: {
trailingSlash: 'ignore',
Expand Down Expand Up @@ -371,7 +365,6 @@ describe('Preview Routing', () => {
projectRoot: './fixtures/with-subpath-no-trailing-slash/',
buildOptions: {
pageUrlFormat: 'file',
legacyBuild: true
},
devOptions: {
trailingSlash: 'ignore',
Expand Down

0 comments on commit 15fe032

Please sign in to comment.