summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/css-head-mdx.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/mdx/test/css-head-mdx.test.js')
-rw-r--r--packages/integrations/mdx/test/css-head-mdx.test.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js
index ed1c6d1d6..8b5764625 100644
--- a/packages/integrations/mdx/test/css-head-mdx.test.js
+++ b/packages/integrations/mdx/test/css-head-mdx.test.js
@@ -1,7 +1,8 @@
import mdx from '@astrojs/mdx';
-import { expect } from 'chai';
import { parseHTML } from 'linkedom';
+import { describe, it, before } from 'node:test';
+import * as assert from 'node:assert/strict';
import { loadFixture } from '../../../astro/test/test-utils.js';
import * as cheerio from 'cheerio';
@@ -27,10 +28,10 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- expect(links).to.have.a.lengthOf(1);
+ assert.equal(links.length, 1);
const scripts = document.querySelectorAll('head script[type=module]');
- expect(scripts).to.have.a.lengthOf(1);
+ assert.equal(scripts.length, 1);
});
it('injects into the head for content collections', async () => {
@@ -38,7 +39,7 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- expect(links).to.have.a.lengthOf(1);
+ assert.equal(links.length, 1);
});
it('injects content from a component using Content#render()', async () => {
@@ -46,10 +47,10 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- expect(links).to.have.a.lengthOf(1);
+ assert.equal(links.length, 1);
const scripts = document.querySelectorAll('head script[type=module]');
- expect(scripts).to.have.a.lengthOf(2);
+ assert.equal(scripts.length, 2);
});
it('Using component using slots.render() API', async () => {
@@ -57,7 +58,7 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- expect(links).to.have.a.lengthOf(1);
+ assert.equal(links.length, 1);
});
it('Using component but no layout', async () => {
@@ -66,10 +67,10 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- expect(headLinks).to.have.a.lengthOf(1);
+ assert.equal(headLinks.length, 1);
const bodyLinks = $('body link[rel=stylesheet]');
- expect(bodyLinks).to.have.a.lengthOf(0);
+ assert.equal(bodyLinks.length, 0);
});
it('JSX component rendering Astro children within head buffering phase', async () => {
@@ -78,10 +79,10 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- expect(headLinks).to.have.a.lengthOf(1);
+ assert.equal(headLinks.length, 1);
const bodyLinks = $('body link[rel=stylesheet]');
- expect(bodyLinks).to.have.a.lengthOf(0);
+ assert.equal(bodyLinks.length, 0);
});
it('Injection caused by delayed slots', async () => {
@@ -91,10 +92,10 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- expect(headLinks).to.have.a.lengthOf(1);
+ assert.equal(headLinks.length, 1);
const bodyLinks = $('body link[rel=stylesheet]');
- expect(bodyLinks).to.have.a.lengthOf(0);
+ assert.equal(bodyLinks.length, 0);
});
});
});