Skip to content

Commit

Permalink
Fix Windows LogBox Test (vercel#13147)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored and chibicode committed May 21, 2020
1 parent b95fa06 commit 9a9ebb7
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions test/acceptance/ReactRefreshLogBox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,31 @@ test('module init error not shown', async () => {
)

expect(await session.hasRedbox(true)).toBe(true)
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"index.js (4:12) @ eval
2 | // top offset for snapshot
3 | import * as React from 'react';
> 4 | throw new Error('no')
| ^
5 | class ClassDefault extends React.Component {
6 | render() {
7 | return <h1>Default Export</h1>;"
`)
if (process.platform === 'win32') {
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"index.js (4:12) @ Module../index.js
2 | // top offset for snapshot
3 | import * as React from 'react';
> 4 | throw new Error('no')
| ^
5 | class ClassDefault extends React.Component {
6 | render() {
7 | return <h1>Default Export</h1>;"
`)
} else {
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"index.js (4:12) @ eval
2 | // top offset for snapshot
3 | import * as React from 'react';
> 4 | throw new Error('no')
| ^
5 | class ClassDefault extends React.Component {
6 | render() {
7 | return <h1>Default Export</h1>;"
`)
}

await cleanup()
})
Expand Down

0 comments on commit 9a9ebb7

Please sign in to comment.