summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/mdx-math.test.js
diff options
context:
space:
mode:
authorGravatar Alex Nguyen <dev@alexnguyen.co.nz> 2024-01-31 21:37:34 +1300
committerGravatar GitHub <noreply@github.com> 2024-01-31 08:37:34 +0000
commit11d5e52710def26b4fd8dcff503c9ff4b87f6f5a (patch)
treeb874374356553bd2e2023334aa540e4437fffc69 /packages/integrations/mdx/test/mdx-math.test.js
parent6dbafb8f5f34d54124a564f70b1cc3d152855bf2 (diff)
downloadastro-11d5e52710def26b4fd8dcff503c9ff4b87f6f5a.tar.gz
astro-11d5e52710def26b4fd8dcff503c9ff4b87f6f5a.tar.zst
astro-11d5e52710def26b4fd8dcff503c9ff4b87f6f5a.zip
migrate MDX tests (#9894)
Diffstat (limited to 'packages/integrations/mdx/test/mdx-math.test.js')
-rw-r--r--packages/integrations/mdx/test/mdx-math.test.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/packages/integrations/mdx/test/mdx-math.test.js b/packages/integrations/mdx/test/mdx-math.test.js
index 52ee94a46..cc6169c55 100644
--- a/packages/integrations/mdx/test/mdx-math.test.js
+++ b/packages/integrations/mdx/test/mdx-math.test.js
@@ -1,5 +1,6 @@
import mdx from '@astrojs/mdx';
-import { expect } from 'chai';
+import { describe, it } from 'node:test';
+import * as assert from 'node:assert/strict';
import { parseHTML } from 'linkedom';
import { loadFixture } from '../../../astro/test/test-utils.js';
import remarkMath from 'remark-math';
@@ -25,10 +26,14 @@ describe('MDX math', () => {
const { document } = parseHTML(html);
const mjxContainer = document.querySelector('mjx-container[jax="SVG"]');
- expect(mjxContainer).to.not.be.null;
+ assert.notEqual(mjxContainer, null);
const mjxStyle = document.querySelector('style').innerHTML;
- expect(mjxStyle).to.include('mjx-container[jax="SVG"]', 'style should not be html-escaped');
+ assert.equal(
+ mjxStyle.includes('mjx-container[jax="SVG"]'),
+ true,
+ 'style should not be html-escaped'
+ );
});
it('works with chtml', async () => {
@@ -55,10 +60,14 @@ describe('MDX math', () => {
const { document } = parseHTML(html);
const mjxContainer = document.querySelector('mjx-container[jax="CHTML"]');
- expect(mjxContainer).to.not.be.null;
+ assert.notEqual(mjxContainer, null);
const mjxStyle = document.querySelector('style').innerHTML;
- expect(mjxStyle).to.include('mjx-container[jax="CHTML"]', 'style should not be html-escaped');
+ assert.equal(
+ mjxStyle.includes('mjx-container[jax="CHTML"]'),
+ true,
+ 'style should not be html-escaped'
+ );
});
});
});