From 770e8f74392b79b34a073a1ada4a819542ad3166 Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Fri, 9 Oct 2020 21:23:00 +0900 Subject: [PATCH] Use runSync --- README.md | 2 +- src/index.spec.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 24ee7645..990080d0 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ const processor = unified().use(slateToRemark).use(stringify, { incrementListMarker: false, }); -const tree = await processor.run({ +const tree = processor.runSync({ type: "root", children: value, }); diff --git a/src/index.spec.js b/src/index.spec.js index a6753c9f..ca1c6108 100644 --- a/src/index.spec.js +++ b/src/index.spec.js @@ -11,13 +11,13 @@ describe("e2e", () => { .use(remarkToSlate); const toRemarkProcessor = unified().use(slateToRemark).use(stringify); - it("plain text", async () => { + it("plain text", () => { const slateNodes = toSlateProcessor.processSync( fs.readFileSync(path.join(__dirname, "../fixture/plain-text.md")) ).result; expect(slateNodes).toMatchSnapshot(); - const mdastTree = await toRemarkProcessor.run({ + const mdastTree = toRemarkProcessor.runSync({ type: "root", children: slateNodes, }); @@ -27,13 +27,13 @@ describe("e2e", () => { expect(text).toMatchSnapshot(); }); - it("headings", async () => { + it("headings", () => { const slateNodes = toSlateProcessor.processSync( fs.readFileSync(path.join(__dirname, "../fixture/headings.md")) ).result; expect(slateNodes).toMatchSnapshot(); - const mdastTree = await toRemarkProcessor.run({ + const mdastTree = toRemarkProcessor.runSync({ type: "root", children: slateNodes, }); @@ -43,13 +43,13 @@ describe("e2e", () => { expect(text).toMatchSnapshot(); }); - it("article", async () => { + it("article", () => { const slateNodes = toSlateProcessor.processSync( fs.readFileSync(path.join(__dirname, "../fixture/article.md")) ).result; expect(slateNodes).toMatchSnapshot(); - const mdastTree = await toRemarkProcessor.run({ + const mdastTree = toRemarkProcessor.runSync({ type: "root", children: slateNodes, });