summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/test/propagated-assets.test.js
diff options
context:
space:
mode:
authorGravatar ktym4a <shoma@ktym4a.me> 2024-01-31 17:37:39 +0700
committerGravatar GitHub <noreply@github.com> 2024-01-31 10:37:39 +0000
commitbfc145b77875e0c91bc09d0b228f8ca8ef8e1023 (patch)
treed18432ead53a17d2e87ddb7e399220eae04b6d19 /packages/integrations/markdoc/test/propagated-assets.test.js
parent8dc7b39a6203af8426ea786bd1d8ed7fd9d35003 (diff)
downloadastro-bfc145b77875e0c91bc09d0b228f8ca8ef8e1023.tar.gz
astro-bfc145b77875e0c91bc09d0b228f8ca8ef8e1023.tar.zst
astro-bfc145b77875e0c91bc09d0b228f8ca8ef8e1023.zip
chore(@astrojs/markdoc): use Node.js for testing (#9897)
Diffstat (limited to 'packages/integrations/markdoc/test/propagated-assets.test.js')
-rw-r--r--packages/integrations/markdoc/test/propagated-assets.test.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/integrations/markdoc/test/propagated-assets.test.js b/packages/integrations/markdoc/test/propagated-assets.test.js
index 4326233c1..652c60014 100644
--- a/packages/integrations/markdoc/test/propagated-assets.test.js
+++ b/packages/integrations/markdoc/test/propagated-assets.test.js
@@ -1,6 +1,7 @@
import { parseHTML } from 'linkedom';
-import { expect } from 'chai';
import { loadFixture } from '../../../astro/test/test-utils.js';
+import assert from 'node:assert/strict';
+import { after, before, describe, it } from 'node:test';
describe('Markdoc - propagated assets', () => {
let fixture;
@@ -44,23 +45,23 @@ describe('Markdoc - propagated assets', () => {
let styleContents;
if (mode === 'dev') {
const styles = stylesDocument.querySelectorAll('style');
- expect(styles).to.have.lengthOf(1);
+ assert.equal(styles.length, 1);
styleContents = styles[0].textContent;
} else {
const links = stylesDocument.querySelectorAll('link[rel="stylesheet"]');
- expect(links).to.have.lengthOf(1);
+ assert.equal(links.length, 1);
styleContents = await fixture.readFile(links[0].href);
}
- expect(styleContents).to.include('--color-base-purple: 269, 79%;');
+ assert.equal(styleContents.includes('--color-base-purple: 269, 79%;'), true);
});
it('[fails] Does not bleed styles to other page', async () => {
if (mode === 'dev') {
const styles = scriptsDocument.querySelectorAll('style');
- expect(styles).to.have.lengthOf(0);
+ assert.equal(styles.length, 0);
} else {
const links = scriptsDocument.querySelectorAll('link[rel="stylesheet"]');
- expect(links).to.have.lengthOf(0);
+ assert.equal(links.length, 0);
}
});
});