0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

chore: migrate static-build-page-dist-url.test.js to node:test (#10048)

This commit is contained in:
Ming-jun Lu 2024-02-08 18:17:43 +08:00 committed by GitHub
parent 2bff75282a
commit 4e506e0659
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
import { expect } from 'chai';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Static build: pages routes have distURL', () => {
@ -22,14 +23,9 @@ describe('Static build: pages routes have distURL', () => {
await fixture.build();
});
it('Pages routes have distURL', async () => {
expect(checkRoutes).to.have.lengthOf.above(
0,
'Pages not found: build end hook not being called'
);
checkRoutes.forEach((p) =>
expect(p)
.to.have.property('distURL')
.that.is.a('URL', `${p.pathname} doesn't include distURL`)
);
assert.equal(checkRoutes.length > 0, true, 'Pages not found: build end hook not being called');
checkRoutes.forEach((p) => {
assert.equal(p.distURL instanceof URL, true, `${p.pathname} doesn't include distURL`);
});
});
});