summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/test/plugins.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/test/plugins.test.js')
-rw-r--r--packages/markdown/remark/test/plugins.test.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/markdown/remark/test/plugins.test.js b/packages/markdown/remark/test/plugins.test.js
index 35e5dcaf8..ce2401047 100644
--- a/packages/markdown/remark/test/plugins.test.js
+++ b/packages/markdown/remark/test/plugins.test.js
@@ -1,5 +1,4 @@
-import { renderMarkdown } from '../dist/index.js';
-import { mockRenderMarkdownParams } from './test-utils.js';
+import { createMarkdownProcessor } from '../dist/index.js';
import chai from 'chai';
import { fileURLToPath } from 'node:url';
@@ -8,9 +7,8 @@ describe('plugins', () => {
// https://github.com/withastro/astro/issues/3264
it('should be able to get file path when passing fileURL', async () => {
let context;
- await renderMarkdown(`test`, {
- ...mockRenderMarkdownParams,
- fileURL: new URL('virtual.md', import.meta.url),
+
+ const processor = await createMarkdownProcessor({
remarkPlugins: [
function () {
const transformer = (tree, file) => {
@@ -22,6 +20,10 @@ describe('plugins', () => {
],
});
+ await processor.render(`test`, {
+ fileURL: new URL('virtual.md', import.meta.url),
+ });
+
chai.expect(typeof context).to.equal('object');
chai.expect(context.path).to.equal(fileURLToPath(new URL('virtual.md', import.meta.url)));
});