[ci] format
This commit is contained in:
parent
79b9ebc83a
commit
d92d28317f
1 changed files with 19 additions and 17 deletions
|
@ -5,30 +5,32 @@ describe('Static build: pages routes have distURL', () => {
|
||||||
/** @type {import('./test-utils').Fixture} */
|
/** @type {import('./test-utils').Fixture} */
|
||||||
let fixture;
|
let fixture;
|
||||||
/** @type {RouteData[]} */
|
/** @type {RouteData[]} */
|
||||||
let checkRoutes
|
let checkRoutes;
|
||||||
before(async () => {
|
before(async () => {
|
||||||
const fixture = await loadFixture({
|
const fixture = await loadFixture({
|
||||||
root: './fixtures/astro pages/',
|
root: './fixtures/astro pages/',
|
||||||
integrations: [{
|
integrations: [
|
||||||
name: '@astrojs/distURL',
|
{
|
||||||
hooks: {
|
name: '@astrojs/distURL',
|
||||||
'astro:build:done': ({ routes }) => {
|
hooks: {
|
||||||
checkRoutes = routes.filter(p => p.type === 'page')
|
'astro:build:done': ({ routes }) => {
|
||||||
|
checkRoutes = routes.filter((p) => p.type === 'page');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}]
|
],
|
||||||
});
|
});
|
||||||
await fixture.build();
|
await fixture.build();
|
||||||
})
|
});
|
||||||
it('Pages routes have distURL', async () => {
|
it('Pages routes have distURL', async () => {
|
||||||
expect(checkRoutes).to.have.lengthOf.above(0, 'Pages not found: build end hook not being called')
|
expect(checkRoutes).to.have.lengthOf.above(
|
||||||
checkRoutes.forEach(p => expect(p).to.have.property(
|
0,
|
||||||
'distURL'
|
'Pages not found: build end hook not being called'
|
||||||
).that.is.a(
|
);
|
||||||
'URL', `${p.pathname} doesn't include distURL`
|
checkRoutes.forEach((p) =>
|
||||||
));
|
expect(p)
|
||||||
|
.to.have.property('distURL')
|
||||||
|
.that.is.a('URL', `${p.pathname} doesn't include distURL`)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue