Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
const root = ReactDOM.createRoot(container);
    const work = root.render(<AsyncMode>Hi</AsyncMode>);
    let ops = [];
    work.then(() => {
      ops.push('inside callback: ' + container.textContent);
    });
    ops.push('before committing: ' + container.textContent);
    flush();
    ops.push('after committing: ' + container.textContent);
    expect(ops).toEqual([
      'before committing: ',
      
      'inside callback: Hi',
      'after committing: Hi',
    ]);
  });
  it('resolves `work.then` callback synchronously if the work already committed', () => {
    const root = ReactDOM.createRoot(container);
    const work = root.render(<AsyncMode>Hi</AsyncMode>);
    flush();
    let ops = [];
    work.then(() => {
      ops.push('inside callback');
    });
    expect(ops).toEqual(['inside callback']);
  });
  it('supports hydration', async () => {
    const markup = await new Promise(resolve =>
      resolve(
        ReactDOMServer.renderToString(