'use strict';
let parseStackTrace;
describe('ReactFlightStackConfigV8', () => {
beforeEach(() => {
jest.resetModules();
parseStackTrace =
require('react-server/src/ReactFlightStackConfigV8').parseStackTrace;
});
it('strips the async prefix from a frame name in an already formatted stack', () => {
const error = new Error();
error.stack =
'Error: boom\n' +
' at inner (/tmp/app.js:1:44)\n' +
' at async outerName (/tmp/app.js:2:30)';
expect(parseStackTrace(error, 1)).toEqual([
['inner', '/tmp/app.js', 1, 44, 0, 0, false],
['outerName', '/tmp/app.js', 2, 30, 0, 0, true],
]);
});
});