summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar tony-sull <tony-sull@users.noreply.github.com> 2022-05-20 19:59:55 +0000
committerGravatar github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2022-05-20 19:59:55 +0000
commit1f148dbcfd10c1088cf7ec995aefe506961a9523 (patch)
tree3b10b879376481d418283c6e2d2265292929fe98
parent63735084585735009186498db95e4bb7d3d62b90 (diff)
downloadastro-1f148dbcfd10c1088cf7ec995aefe506961a9523.tar.gz
astro-1f148dbcfd10c1088cf7ec995aefe506961a9523.tar.zst
astro-1f148dbcfd10c1088cf7ec995aefe506961a9523.zip
[ci] format
-rw-r--r--packages/astro/src/core/build/page-data.ts2
-rw-r--r--packages/astro/test/routing-priority.test.js84
2 files changed, 43 insertions, 43 deletions
diff --git a/packages/astro/src/core/build/page-data.ts b/packages/astro/src/core/build/page-data.ts
index fee13ea49..c40ee40da 100644
--- a/packages/astro/src/core/build/page-data.ts
+++ b/packages/astro/src/core/build/page-data.ts
@@ -163,7 +163,7 @@ export async function collectPagesData(
});
finalPaths.map((staticPath) => builtPaths.add(removeTrailingForwardSlash(staticPath)));
-
+
allPages[route.component] = {
component: route.component,
route,
diff --git a/packages/astro/test/routing-priority.test.js b/packages/astro/test/routing-priority.test.js
index 1075ea5b1..097ef1f8b 100644
--- a/packages/astro/test/routing-priority.test.js
+++ b/packages/astro/test/routing-priority.test.js
@@ -8,61 +8,61 @@ let fixture;
const routes = [
{
url: '/',
- h1: 'index.astro'
+ h1: 'index.astro',
},
{
url: '/posts/post-1',
h1: 'posts/[pid].astro',
- p: 'post-1'
+ p: 'post-1',
},
{
url: '/posts/post-2',
h1: 'posts/[pid].astro',
- p: 'post-2'
+ p: 'post-2',
},
{
url: '/posts/1/2',
h1: 'posts/[...slug].astro',
- p: '1/2'
+ p: '1/2',
},
- {
+ {
url: '/de',
- h1: 'de/index.astro'
+ h1: 'de/index.astro',
},
{
url: '/de/',
- h1: 'de/index.astro'
+ h1: 'de/index.astro',
},
{
url: '/de/index.html',
- h1: 'de/index.astro'
+ h1: 'de/index.astro',
},
{
url: '/en',
h1: '[lang]/index.astro',
- p: 'en'
+ p: 'en',
},
{
url: '/en/',
h1: '[lang]/index.astro',
- p: 'en'
+ p: 'en',
},
{
url: '/en/index.html',
h1: '[lang]/index.astro',
- p: 'en'
+ p: 'en',
},
{
url: '/de/1/2',
h1: '[lang]/[...catchall].astro',
- p: 'de | 1/2'
+ p: 'de | 1/2',
},
{
url: '/en/1/2',
h1: '[lang]/[...catchall].astro',
- p: 'en | 1/2'
- }
-]
+ p: 'en | 1/2',
+ },
+];
describe('Routing priority', () => {
before(async () => {
@@ -119,7 +119,7 @@ describe('Routing priority', () => {
const $ = cheerioLoad(html);
expect($('h1').text()).to.equal('[lang]/[...catchall].astro');
- expect($('p').text()).to.equal('de | 1/2')
+ expect($('p').text()).to.equal('de | 1/2');
});
it('matches /en/1/2 to [lang]/[...catchall].astro', async () => {
@@ -127,7 +127,7 @@ describe('Routing priority', () => {
const $ = cheerioLoad(html);
expect($('h1').text()).to.equal('[lang]/[...catchall].astro');
- expect($('p').text()).to.equal('en | 1/2')
+ expect($('p').text()).to.equal('en | 1/2');
});
});
@@ -144,77 +144,77 @@ describe('Routing priority', () => {
it('matches / to index.astro', async () => {
const html = await fixture.fetch('/').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('index.astro');
+ expect($('h1').text()).to.equal('index.astro');
});
it('matches /posts/post-1 to /posts/[pid].astro', async () => {
const html = await fixture.fetch('/posts/post-1').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('posts/[pid].astro');
- expect($('p').text()).to.equal('post-1');
+ expect($('h1').text()).to.equal('posts/[pid].astro');
+ expect($('p').text()).to.equal('post-1');
});
it('matches /posts/1/2 to /posts/[...slug].astro', async () => {
const html = await fixture.fetch('/posts/1/2').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('posts/[...slug].astro');
- expect($('p').text()).to.equal('1/2');
+ expect($('h1').text()).to.equal('posts/[...slug].astro');
+ expect($('p').text()).to.equal('1/2');
});
it('matches /de to de/index.astro', async () => {
const html = await fixture.fetch('/de').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('de/index.astro');
+ expect($('h1').text()).to.equal('de/index.astro');
});
it('matches /de to de/index.astro', async () => {
const html = await fixture.fetch('/de').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('de/index.astro');
+ expect($('h1').text()).to.equal('de/index.astro');
});
it('matches /de/ to de/index.astro', async () => {
const html = await fixture.fetch('/de/').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('de/index.astro');
+ expect($('h1').text()).to.equal('de/index.astro');
});
it('matches /de/index.html to de/index.astro', async () => {
const html = await fixture.fetch('/de/index.html').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('de/index.astro');
+ expect($('h1').text()).to.equal('de/index.astro');
});
it('matches /en to [lang]/index.astro', async () => {
const html = await fixture.fetch('/en').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('[lang]/index.astro');
- expect($('p').text()).to.equal('en');
+ expect($('h1').text()).to.equal('[lang]/index.astro');
+ expect($('p').text()).to.equal('en');
});
it('matches /en/ to [lang]/index.astro', async () => {
const html = await fixture.fetch('/en/').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('[lang]/index.astro');
- expect($('p').text()).to.equal('en');
+ expect($('h1').text()).to.equal('[lang]/index.astro');
+ expect($('p').text()).to.equal('en');
});
it('matches /en/index.html to de/index.astro', async () => {
const html = await fixture.fetch('/en/index.html').then((res) => res.text());
- const $ = cheerioLoad(html);
+ const $ = cheerioLoad(html);
- expect($('h1').text()).to.equal('[lang]/index.astro');
- expect($('p').text()).to.equal('en');
+ expect($('h1').text()).to.equal('[lang]/index.astro');
+ expect($('p').text()).to.equal('en');
});
it('matches /de/1/2 to [lang]/[...catchall].astro', async () => {