summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/mdx-script-style-raw.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/mdx/test/mdx-script-style-raw.test.js')
-rw-r--r--packages/integrations/mdx/test/mdx-script-style-raw.test.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/packages/integrations/mdx/test/mdx-script-style-raw.test.js b/packages/integrations/mdx/test/mdx-script-style-raw.test.js
index 99c17ed8d..cac3e7823 100644
--- a/packages/integrations/mdx/test/mdx-script-style-raw.test.js
+++ b/packages/integrations/mdx/test/mdx-script-style-raw.test.js
@@ -1,5 +1,6 @@
import mdx from '@astrojs/mdx';
-import { expect } from 'chai';
+import { describe, it, before, after } from 'node:test';
+import * as assert from 'node:assert/strict';
import { parseHTML } from 'linkedom';
import { loadFixture } from '../../../astro/test/test-utils.js';
@@ -24,20 +25,22 @@ describe('MDX script style raw', () => {
it('works with with raw script and style strings', async () => {
const res = await fixture.fetch('/index.html');
- expect(res.status).to.equal(200);
+ assert.equal(res.status, 200);
const html = await res.text();
const { document } = parseHTML(html);
const scriptContent = document.getElementById('test-script').innerHTML;
- expect(scriptContent).to.include(
- "console.log('raw script')",
+ assert.equal(
+ scriptContent.includes("console.log('raw script')"),
+ true,
'script should not be html-escaped'
);
const styleContent = document.getElementById('test-style').innerHTML;
- expect(styleContent).to.include(
- 'h1[id="script-style-raw"]',
+ assert.equal(
+ styleContent.includes('h1[id="script-style-raw"]'),
+ true,
'style should not be html-escaped'
);
});
@@ -55,14 +58,16 @@ describe('MDX script style raw', () => {
const { document } = parseHTML(html);
const scriptContent = document.getElementById('test-script').innerHTML;
- expect(scriptContent).to.include(
- "console.log('raw script')",
+ assert.equal(
+ scriptContent.includes("console.log('raw script')"),
+ true,
'script should not be html-escaped'
);
const styleContent = document.getElementById('test-style').innerHTML;
- expect(styleContent).to.include(
- 'h1[id="script-style-raw"]',
+ assert.equal(
+ styleContent.includes('h1[id="script-style-raw"]'),
+ true,
'style should not be html-escaped'
);
});