Skip to content

Commit

Permalink
Use runSync
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Oct 9, 2020
1 parent 3dc4c9a commit 770e8f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
12 changes: 6 additions & 6 deletions src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand Down

0 comments on commit 770e8f7

Please sign in to comment.