mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
chore: Migrate astro-markdown-remarkRehype.test.js
to node:test
(#10021)
* migrate test * remove old test
This commit is contained in:
parent
b05e6ac26a
commit
7f0e5026e3
1 changed files with 9 additions and 5 deletions
|
@ -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 * as cheerio from 'cheerio';
|
||||||
import { loadFixture } from './test-utils.js';
|
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 () => {
|
it('Renders footnotes with default English labels', async () => {
|
||||||
const html = await fixture.readFile('/index.html');
|
const html = await fixture.readFile('/index.html');
|
||||||
const $ = cheerio.load(html);
|
const $ = cheerio.load(html);
|
||||||
expect($('#footnote-label').text()).to.equal('Footnotes');
|
assert.strictEqual($('#footnote-label').text(), 'Footnotes');
|
||||||
expect($('.data-footnote-backref').first().attr('aria-label')).to.equal('Back to reference 1');
|
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 () => {
|
it('Renders footnotes with values from the configuration', async () => {
|
||||||
const html = await fixture.readFile('/index.html');
|
const html = await fixture.readFile('/index.html');
|
||||||
const $ = cheerio.load(html);
|
const $ = cheerio.load(html);
|
||||||
expect($('#footnote-label').text()).to.equal('Catatan kaki');
|
assert.strictEqual($('#footnote-label').text(), 'Catatan kaki');
|
||||||
expect($('.data-footnote-backref').first().attr('aria-label')).to.equal('Kembali ke konten');
|
assert.strictEqual($('.data-footnote-backref').first().attr('aria-label'), 'Kembali ke konten');
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in a new issue