diff --git a/src/index.js b/src/index.js
index 35e642d..87fec39 100644
--- a/src/index.js
+++ b/src/index.js
@@ -377,7 +377,9 @@ function _renderToString(
try {
rendered = type.call(component, props, cctx);
} catch (e) {
- if (asyncMode) vnode._suspended = true;
+ if (asyncMode) {
+ vnode._suspended = true;
+ }
throw e;
}
}
diff --git a/test/compat/async.test.jsx b/test/compat/async.test.jsx
index bf1792b..0ca7835 100644
--- a/test/compat/async.test.jsx
+++ b/test/compat/async.test.jsx
@@ -17,7 +17,7 @@ describe('Async renderToString', () => {
);
- const expected = `
bar
`;
+ const expected = `bar
`;
suspended.resolve();
@@ -40,7 +40,7 @@ describe('Async renderToString', () => {
);
- const expected = `bar
`;
+ const expected = `bar
`;
suspended.resolve();
@@ -73,7 +73,7 @@ describe('Async renderToString', () => {
);
- const expected = ``;
+ const expected = ``;
suspendedOne.resolve();
suspendedTwo.resolve();
@@ -109,7 +109,7 @@ describe('Async renderToString', () => {
);
- const expected = ``;
+ const expected = ``;
suspendedOne.resolve();
suspendedTwo.resolve();
@@ -152,7 +152,7 @@ describe('Async renderToString', () => {
);
- const expected = ``;
+ const expected = ``;
suspendedOne.resolve();
suspendedTwo.resolve();
@@ -164,7 +164,7 @@ describe('Async renderToString', () => {
expect(rendered).to.equal(expected);
});
- it.only('should render JSX with deeply nested suspense boundaries', async () => {
+ it('should render JSX with deeply nested suspense boundaries', async () => {
const {
Suspender: SuspenderOne,
suspended: suspendedOne
@@ -199,7 +199,7 @@ describe('Async renderToString', () => {
);
- const expected = ``;
+ const expected = ``;
suspendedOne.resolve();
suspendedTwo.resolve();
@@ -243,7 +243,7 @@ describe('Async renderToString', () => {
);
- const expected = ``;
+ const expected = ``;
suspendedOne.resolve();
suspendedTwo.resolve();
@@ -303,7 +303,7 @@ describe('Async renderToString', () => {
suspended.resolve();
const rendered = await promise;
- expect(rendered).to.equal('ok
');
+ expect(rendered).to.equal('ok
');
});
it('should work with an in-render suspension', async () => {
@@ -340,7 +340,10 @@ describe('Async renderToString', () => {
);
- expect(rendered).to.equal(`2
`);
+ // Before we get to the actual DOM this suspends twice
+ expect(rendered).to.equal(
+ `2
`
+ );
});
describe('dangerouslySetInnerHTML', () => {