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

chore: Migrate html-component.test.js to node:test (#10040)

This commit is contained in:
Mohamed 2024-02-08 12:21:38 +02:00 committed by GitHub
parent d65332af89
commit 9e3487e13c
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';
@ -23,8 +24,8 @@ describe('HTML Component', () => {
const h1 = $('h1');
const foo = $('#foo');
expect(h1.text()).to.equal('Hello component!');
expect(foo.text()).to.equal('bar');
assert.equal(h1.text(), 'Hello component!');
assert.equal(foo.text(), 'bar');
});
});
@ -42,7 +43,7 @@ describe('HTML Component', () => {
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);
@ -50,8 +51,8 @@ describe('HTML Component', () => {
const h1 = $('h1');
const foo = $('#foo');
expect(h1.text()).to.equal('Hello component!');
expect(foo.text()).to.equal('bar');
assert.equal(h1.text(), 'Hello component!');
assert.equal(foo.text(), 'bar');
});
});
});