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

chore: Migrate html-page.test.js to node:test (#10043)

This commit is contained in:
Mohamed 2024-02-08 12:19:33 +02:00 committed by GitHub
parent 648e714e3e
commit 372c34b84b
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 { after, describe, before, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
@ -22,7 +23,7 @@ describe('HTML Page', () => {
const h1 = $('h1');
expect(h1.text()).to.equal('Hello page!');
assert.equal(h1.text(), 'Hello page!');
});
});
@ -40,14 +41,14 @@ describe('HTML Page', () => {
it('works', async () => {
const res = await fixture.fetch('/');
expect(res.status).to.equal(200);
assert.equal(res.status, 200);
const html = await res.text();
const $ = cheerio.load(html);
const h1 = $('h1');
expect(h1.text()).to.equal('Hello page!');
assert.equal(h1.text(), 'Hello page!');
});
});
});