reiji-h 1 год назад
Родитель
Сommit
45bbfc7e27
1 измененных файлов с 21 добавлено и 18 удалено
  1. 21 18
      packages/remark-growi-directive/test/mdast-util-growi-directive.test.js

+ 21 - 18
packages/remark-growi-directive/test/mdast-util-growi-directive.test.js

@@ -88,14 +88,15 @@ describe('markdown -> mdast', () => {
     });
   });
 
-  let tree = fromMarkdown('x $a[b *c*\nd]', {
-    extensions: [directive()],
-    mdastExtensions: [directiveFromMarkdown],
-  });
-
-  removePosition(tree, { force: true });
 
   it('should support content in a label', () => {
+    const tree = fromMarkdown('x $a[b *c*\nd]', {
+      extensions: [directive()],
+      mdastExtensions: [directiveFromMarkdown],
+    });
+
+    removePosition(tree, { force: true });
+
     expect(tree).toEqual(
       {
         type: 'root',
@@ -121,14 +122,15 @@ describe('markdown -> mdast', () => {
     );
   });
 
-  tree = fromMarkdown('x $a(#b.c.d e=f g="h&i&unknown;j")', {
-    extensions: [directive()],
-    mdastExtensions: [directiveFromMarkdown],
-  });
-
-  removePosition(tree, { force: true });
 
   it('should support attributes', () => {
+    const tree = fromMarkdown('x $a(#b.c.d e=f g="h&i&unknown;j")', {
+      extensions: [directive()],
+      mdastExtensions: [directiveFromMarkdown],
+    });
+
+    removePosition(tree, { force: true });
+
     expect(tree).toEqual({
       type: 'root',
       children: [
@@ -150,14 +152,15 @@ describe('markdown -> mdast', () => {
     });
   });
 
-  tree = fromMarkdown('$a(b\nc="d\ne")', {
-    extensions: [directive()],
-    mdastExtensions: [directiveFromMarkdown],
-  });
-
-  removePosition(tree, { force: true });
 
   it('should support EOLs in attributes', () => {
+    const tree = fromMarkdown('$a(b\nc="d\ne")', {
+      extensions: [directive()],
+      mdastExtensions: [directiveFromMarkdown],
+    });
+
+    removePosition(tree, { force: true });
+
     expect(tree).toEqual({
       type: 'root',
       children: [