-
Notifications
You must be signed in to change notification settings - Fork 27.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add basic tests for error logs
- Loading branch information
1 parent
fb39f25
commit 9a575b8
Showing
20 changed files
with
435 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
.../next-after-app-errors/react-owner-stack/app/nested-promise-above-callback-2-sync/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { unstable_after } from 'next/server' | ||
import { setTimeout } from 'timers/promises' | ||
|
||
export default function Page() { | ||
return <Wrapper /> | ||
} | ||
|
||
function Wrapper() { | ||
return <Inner /> | ||
} | ||
|
||
function Inner() { | ||
foo() | ||
return null | ||
} | ||
|
||
function foo() { | ||
unstable_after(bar()) | ||
} | ||
|
||
async function bar() { | ||
// TODO(after): it looks like `aboveZap` is not in the stack if `zap` does `setTimeout(0)`? | ||
unstable_after(function aboveZap() { | ||
return zap() | ||
}) | ||
} | ||
|
||
async function zap() { | ||
await setTimeout(0) | ||
throws() | ||
} | ||
|
||
function throws() { | ||
throw new Error('kaboom') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ function Inner() { | |
return null | ||
} | ||
|
||
async function foo() { | ||
function foo() { | ||
unstable_after(bar()) | ||
} | ||
|
||
|
32 changes: 32 additions & 0 deletions
32
...p-dir/next-after-app-errors/react-owner-stack/app/nested-promise-above-callback-4/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { unstable_after } from 'next/server' | ||
|
||
export default function Page() { | ||
return <Wrapper /> | ||
} | ||
|
||
function Wrapper() { | ||
return <Inner /> | ||
} | ||
|
||
async function Inner() { | ||
await foo() | ||
return null | ||
} | ||
|
||
async function foo() { | ||
unstable_after(bar()) | ||
} | ||
|
||
async function bar() { | ||
unstable_after(function aboveZap() { | ||
return zap() | ||
}) | ||
} | ||
|
||
async function zap() { | ||
throws() | ||
} | ||
|
||
function throws() { | ||
throw new Error('kaboom') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
test/e2e/app-dir/next-after-app-errors/react-owner-stack/app/simple-callback/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { unstable_after } from 'next/server' | ||
import { setTimeout } from 'timers/promises' | ||
|
||
export default function Page() { | ||
return <Wrapper /> | ||
} | ||
|
||
function Wrapper() { | ||
return <Inner /> | ||
} | ||
|
||
function Inner() { | ||
helper() | ||
return null | ||
} | ||
|
||
function helper() { | ||
unstable_after(async () => { | ||
await setTimeout(0) | ||
throws() | ||
}) | ||
} | ||
|
||
function throws() { | ||
throw new Error('kaboom') | ||
} |
File renamed without changes.
Oops, something went wrong.