mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
chore: Migrate custom-404-md.test.js
to node:test
(#10036)
This commit is contained in:
parent
a6b62254e4
commit
283a822121
1 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
import { expect } from 'chai';
|
||||
import * as cheerio from 'cheerio';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
import assert from 'node:assert/strict';
|
||||
import { after, describe, before, it } from 'node:test';
|
||||
|
||||
describe('Custom 404 Markdown', () => {
|
||||
let fixture;
|
||||
|
@ -27,17 +28,17 @@ describe('Custom 404 Markdown', () => {
|
|||
const html = await fixture.fetch('/').then((res) => res.text());
|
||||
$ = cheerio.load(html);
|
||||
|
||||
expect($('h1').text()).to.equal('Home');
|
||||
assert.strictEqual($('h1').text(), 'Home');
|
||||
});
|
||||
|
||||
it('renders 404 for /abc', async () => {
|
||||
const res = await fixture.fetch('/a');
|
||||
expect(res.status).to.equal(404);
|
||||
assert.strictEqual(res.status, 404);
|
||||
|
||||
const html = await res.text();
|
||||
$ = cheerio.load(html);
|
||||
|
||||
expect($('h1').text()).to.equal('Page not found');
|
||||
assert.strictEqual($('h1').text(), 'Page not found');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue