Home / File/ plugins.test.js — astro Source File

plugins.test.js — astro Source File

Architecture documentation for plugins.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  f4cd49fc_c975_fd32_5120_0ab45ba7efe0["plugins.test.js"]
  8350d254_ac08_0a3a_4696_d1a19f979b3a["../dist/index.js"]
  f4cd49fc_c975_fd32_5120_0ab45ba7efe0 --> 8350d254_ac08_0a3a_4696_d1a19f979b3a
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  f4cd49fc_c975_fd32_5120_0ab45ba7efe0 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  f4cd49fc_c975_fd32_5120_0ab45ba7efe0 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  f4cd49fc_c975_fd32_5120_0ab45ba7efe0 --> d9a92db9_c95e_9165_13ac_24b3d859d946
  style f4cd49fc_c975_fd32_5120_0ab45ba7efe0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { createMarkdownProcessor } from '../dist/index.js';

describe('plugins', () => {
	it('should be able to get file path when passing fileURL', async () => {
		let context;

		const processor = await createMarkdownProcessor({
			remarkPlugins: [
				() => {
					const transformer = (_tree, file) => {
						context = file;
					};
					return transformer;
				},
			],
		});

		await processor.render(`test`, {
			fileURL: new URL('virtual.md', import.meta.url),
		});

		assert.ok(typeof context === 'object');
		assert.equal(context.path, fileURLToPath(new URL('virtual.md', import.meta.url)));
	});
});

Domain

Dependencies

  • ../dist/index.js
  • node:test
  • node:url
  • strict

Frequently Asked Questions

What does plugins.test.js do?
plugins.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does plugins.test.js depend on?
plugins.test.js imports 4 module(s): ../dist/index.js, node:test, node:url, strict.
Where is plugins.test.js in the architecture?
plugins.test.js is located at packages/markdown/remark/test/plugins.test.js (domain: CoreAstro, directory: packages/markdown/remark/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free