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

chore: Migrate astro-markdown-remarkRehype.test.js to node:test (#10021)

* migrate test

* remove old test
This commit is contained in:
voxel!() 2024-02-08 02:12:59 -08:00 committed by GitHub
parent b05e6ac26a
commit 7f0e5026e3
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 { describe, before, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
@ -14,8 +15,11 @@ describe('Astro Markdown without remark-rehype config', () => {
it('Renders footnotes with default English labels', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('#footnote-label').text()).to.equal('Footnotes');
expect($('.data-footnote-backref').first().attr('aria-label')).to.equal('Back to reference 1');
assert.strictEqual($('#footnote-label').text(), 'Footnotes');
assert.strictEqual(
$('.data-footnote-backref').first().attr('aria-label'),
'Back to reference 1'
);
});
});
@ -37,7 +41,7 @@ describe('Astro Markdown with remark-rehype config', () => {
it('Renders footnotes with values from the configuration', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('#footnote-label').text()).to.equal('Catatan kaki');
expect($('.data-footnote-backref').first().attr('aria-label')).to.equal('Kembali ke konten');
assert.strictEqual($('#footnote-label').text(), 'Catatan kaki');
assert.strictEqual($('.data-footnote-backref').first().attr('aria-label'), 'Kembali ke konten');
});
});