summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/test/content-collections.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/content-collections.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/content-collections.test.js')
-rw-r--r--packages/integrations/markdoc/test/content-collections.test.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/packages/integrations/markdoc/test/content-collections.test.js b/packages/integrations/markdoc/test/content-collections.test.js
index aad389e0c..cfd1c80c7 100644
--- a/packages/integrations/markdoc/test/content-collections.test.js
+++ b/packages/integrations/markdoc/test/content-collections.test.js
@@ -1,7 +1,8 @@
import { parse as parseDevalue } from 'devalue';
-import { expect } from 'chai';
import { loadFixture, fixLineEndings } from '../../../astro/test/test-utils.js';
import markdoc from '../dist/index.js';
+import assert from 'node:assert/strict';
+import { after, before, describe, it } from 'node:test';
function formatPost(post) {
return {
@@ -36,19 +37,18 @@ describe('Markdoc - Content Collections', () => {
it('loads entry', async () => {
const res = await baseFixture.fetch('/entry.json');
const post = parseDevalue(await res.text());
- expect(formatPost(post)).to.deep.equal(post1Entry);
+ assert.deepEqual(formatPost(post), post1Entry);
});
it('loads collection', async () => {
const res = await baseFixture.fetch('/collection.json');
const posts = parseDevalue(await res.text());
- expect(posts).to.not.be.null;
+ assert.notEqual(posts, null);
- expect(posts.sort().map((post) => formatPost(post))).to.deep.equal([
- post1Entry,
- post2Entry,
- post3Entry,
- ]);
+ assert.deepEqual(
+ posts.sort().map((post) => formatPost(post)),
+ [post1Entry, post2Entry, post3Entry]
+ );
});
});
@@ -60,18 +60,17 @@ describe('Markdoc - Content Collections', () => {
it('loads entry', async () => {
const res = await baseFixture.readFile('/entry.json');
const post = parseDevalue(res);
- expect(formatPost(post)).to.deep.equal(post1Entry);
+ assert.deepEqual(formatPost(post), post1Entry);
});
it('loads collection', async () => {
const res = await baseFixture.readFile('/collection.json');
const posts = parseDevalue(res);
- expect(posts).to.not.be.null;
- expect(posts.sort().map((post) => formatPost(post))).to.deep.equal([
- post1Entry,
- post2Entry,
- post3Entry,
- ]);
+ assert.notEqual(posts, null);
+ assert.deepEqual(
+ posts.sort().map((post) => formatPost(post)),
+ [post1Entry, post2Entry, post3Entry]
+ );
});
});
});