0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

chore: Migrate custom-404-implicit-rerouting.test.js to node:test (#10026)

This commit is contained in:
ktym4a 2024-02-08 17:26:03 +07:00 committed by GitHub
parent a941de1d6d
commit ccb08ea7c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,6 @@
import { expect } from 'chai';
import { loadFixture } from './test-utils.js';
import assert from 'node:assert/strict';
import { after, describe, before, it } from 'node:test';
for (const caseNumber of [1, 2, 3, 4]) {
describe(`Custom 404 with implicit rerouting - Case #${caseNumber}`, () => {
@ -21,15 +22,15 @@ for (const caseNumber of [1, 2, 3, 4]) {
it('dev server handles normal requests', async () => {
const resPromise = fixture.fetch('/');
const result = await withTimeout(resPromise, 1000);
expect(result).to.not.equal(timeout);
expect(result.status).to.equal(200);
assert.notStrictEqual(result, timeout);
assert.strictEqual(result.status, 200);
});
it('dev server stays responsive', async () => {
const resPromise = fixture.fetch('/alvsibdlvjks');
const result = await withTimeout(resPromise, 1000);
expect(result).to.not.equal(timeout);
expect(result.status).to.equal(404);
assert.notStrictEqual(result, timeout);
assert.strictEqual(result.status, 404);
});
after(async () => {