aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_utils/to_document.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 16:27:38 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 16:27:38 +0200
commite484d1ecc5e405259767c0fd84072226fee40b71 (patch)
tree71d2a2f67870052aa026d0087dfb06cb96c40e17 /tests/test_utils/to_document.rs
parent73d8609565b808ac73df5ac34e6d4f7f23c25ad6 (diff)
downloadmarkdown-rs-e484d1ecc5e405259767c0fd84072226fee40b71.tar.gz
markdown-rs-e484d1ecc5e405259767c0fd84072226fee40b71.tar.bz2
markdown-rs-e484d1ecc5e405259767c0fd84072226fee40b71.zip
Refactor test utilities to improve names
Diffstat (limited to '')
-rw-r--r--tests/test_utils/mdx_plugin_recma_document.rs (renamed from tests/test_utils/to_document.rs)11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_utils/to_document.rs b/tests/test_utils/mdx_plugin_recma_document.rs
index 938df1b..a62862c 100644
--- a/tests/test_utils/to_document.rs
+++ b/tests/test_utils/mdx_plugin_recma_document.rs
@@ -1,7 +1,12 @@
+//! Turn a JavaScript AST, coming from MD(X), into a component.
+//!
+//! Port of <https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/recma-document.js>,
+//! by the same author.
+
extern crate swc_ecma_ast;
use crate::test_utils::{
- micromark_swc_utils::{bytepos_to_point, prefix_error_with_point, span_to_position},
- to_swc::Program,
+ hast_util_to_swc::Program,
+ swc_utils::{bytepos_to_point, prefix_error_with_point, span_to_position},
};
use micromark::{
unist::{Point, Position},
@@ -66,7 +71,7 @@ impl Default for Options {
}
#[allow(dead_code)]
-pub fn to_document(
+pub fn mdx_plugin_recma_document(
mut program: Program,
options: &Options,
location: Option<&Location>,