@@ -12,6 +12,8 @@ import {
12
12
} from 'next-test-utils'
13
13
import stripAnsi from 'strip-ansi'
14
14
15
+ const isRspack = process . env . NEXT_RSPACK !== undefined
16
+
15
17
const appDir = join ( __dirname , '../' )
16
18
const gspPage = join ( appDir , 'pages/gsp.js' )
17
19
const gsspPage = join ( appDir , 'pages/gssp.js' )
@@ -518,7 +520,7 @@ describe('server-side dev errors', () => {
518
520
)
519
521
. trim ( )
520
522
// FIXME(veil): error repeated
521
- if ( isTurbopack ) {
523
+ if ( isTurbopack || isRspack ) {
522
524
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
523
525
"Error: catch this rejection
524
526
at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19)
@@ -597,65 +599,65 @@ describe('server-side dev errors', () => {
597
599
)
598
600
. trim ( )
599
601
// FIXME(veil): error repeated
600
- if ( isTurbopack ) {
602
+ if ( isTurbopack || isRspack ) {
601
603
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
602
- "Error:
603
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
604
- 5 | export async function getServerSideProps() {
605
- 6 | setTimeout(() => {
606
- > 7 | Promise.reject(new Error())
607
- | ^
608
- 8 | }, 10)
609
- 9 | return {
610
- 10 | props: {},
611
- ⨯ unhandledRejection: Error:
612
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
613
- 5 | export async function getServerSideProps() {
614
- 6 | setTimeout(() => {
615
- > 7 | Promise.reject(new Error())
616
- | ^
617
- 8 | }, 10)
618
- 9 | return {
619
- 10 | props: {},
620
- ⨯ unhandledRejection: Error:
621
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
622
- 5 | export async function getServerSideProps() {
623
- 6 | setTimeout(() => {
624
- > 7 | Promise.reject(new Error())
625
- | ^
626
- 8 | }, 10)
627
- 9 | return {
628
- 10 | props: {},"
604
+ "Error:
605
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
606
+ 5 | export async function getServerSideProps() {
607
+ 6 | setTimeout(() => {
608
+ > 7 | Promise.reject(new Error())
609
+ | ^
610
+ 8 | }, 10)
611
+ 9 | return {
612
+ 10 | props: {},
613
+ ⨯ unhandledRejection: Error:
614
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
615
+ 5 | export async function getServerSideProps() {
616
+ 6 | setTimeout(() => {
617
+ > 7 | Promise.reject(new Error())
618
+ | ^
619
+ 8 | }, 10)
620
+ 9 | return {
621
+ 10 | props: {},
622
+ ⨯ unhandledRejection: Error:
623
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
624
+ 5 | export async function getServerSideProps() {
625
+ 6 | setTimeout(() => {
626
+ > 7 | Promise.reject(new Error())
627
+ | ^
628
+ 8 | }, 10)
629
+ 9 | return {
630
+ 10 | props: {},"
629
631
` )
630
632
} else {
631
633
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
632
- "Error:
633
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
634
- 5 | export async function getServerSideProps() {
635
- 6 | setTimeout(() => {
636
- > 7 | Promise.reject(new Error())
637
- | ^
638
- 8 | }, 10)
639
- 9 | return {
640
- 10 | props: {},
641
- ⨯ unhandledRejection: Error:
642
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
643
- 5 | export async function getServerSideProps() {
644
- 6 | setTimeout(() => {
645
- > 7 | Promise.reject(new Error())
646
- | ^
647
- 8 | }, 10)
648
- 9 | return {
649
- 10 | props: {},
650
- ⨯ unhandledRejection: Error:
651
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
652
- 5 | export async function getServerSideProps() {
653
- 6 | setTimeout(() => {
654
- > 7 | Promise.reject(new Error())
655
- | ^
656
- 8 | }, 10)
657
- 9 | return {
658
- 10 | props: {},"
634
+ "Error:
635
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
636
+ 5 | export async function getServerSideProps() {
637
+ 6 | setTimeout(() => {
638
+ > 7 | Promise.reject(new Error())
639
+ | ^
640
+ 8 | }, 10)
641
+ 9 | return {
642
+ 10 | props: {},
643
+ ⨯ unhandledRejection: Error:
644
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
645
+ 5 | export async function getServerSideProps() {
646
+ 6 | setTimeout(() => {
647
+ > 7 | Promise.reject(new Error())
648
+ | ^
649
+ 8 | }, 10)
650
+ 9 | return {
651
+ 10 | props: {},
652
+ ⨯ unhandledRejection: Error:
653
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19)
654
+ 5 | export async function getServerSideProps() {
655
+ 6 | setTimeout(() => {
656
+ > 7 | Promise.reject(new Error())
657
+ | ^
658
+ 8 | }, 10)
659
+ 9 | return {
660
+ 10 | props: {},"
659
661
` )
660
662
}
661
663
} )
@@ -675,7 +677,7 @@ describe('server-side dev errors', () => {
675
677
)
676
678
. trim ( )
677
679
// FIXME(veil): error repeated
678
- if ( isTurbopack ) {
680
+ if ( isTurbopack || isRspack ) {
679
681
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
680
682
"Error: catch this exception
681
683
at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10)
@@ -753,65 +755,65 @@ describe('server-side dev errors', () => {
753
755
)
754
756
. trim ( )
755
757
// FIXME(veil): error repeated
756
- if ( isTurbopack ) {
758
+ if ( isTurbopack || isRspack ) {
757
759
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
758
- "Error:
759
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
760
- 5 | export async function getServerSideProps() {
761
- 6 | setTimeout(() => {
762
- > 7 | throw new Error()
763
- | ^
764
- 8 | }, 10)
765
- 9 | return {
766
- 10 | props: {},
767
- ⨯ uncaughtException: Error:
768
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
769
- 5 | export async function getServerSideProps() {
770
- 6 | setTimeout(() => {
771
- > 7 | throw new Error()
772
- | ^
773
- 8 | }, 10)
774
- 9 | return {
775
- 10 | props: {},
776
- ⨯ uncaughtException: Error:
777
- at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
778
- 5 | export async function getServerSideProps() {
779
- 6 | setTimeout(() => {
780
- > 7 | throw new Error()
781
- | ^
782
- 8 | }, 10)
783
- 9 | return {
784
- 10 | props: {},"
760
+ "Error:
761
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
762
+ 5 | export async function getServerSideProps() {
763
+ 6 | setTimeout(() => {
764
+ > 7 | throw new Error()
765
+ | ^
766
+ 8 | }, 10)
767
+ 9 | return {
768
+ 10 | props: {},
769
+ ⨯ uncaughtException: Error:
770
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
771
+ 5 | export async function getServerSideProps() {
772
+ 6 | setTimeout(() => {
773
+ > 7 | throw new Error()
774
+ | ^
775
+ 8 | }, 10)
776
+ 9 | return {
777
+ 10 | props: {},
778
+ ⨯ uncaughtException: Error:
779
+ at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
780
+ 5 | export async function getServerSideProps() {
781
+ 6 | setTimeout(() => {
782
+ > 7 | throw new Error()
783
+ | ^
784
+ 8 | }, 10)
785
+ 9 | return {
786
+ 10 | props: {},"
785
787
` )
786
788
} else {
787
789
expect ( stderrOutput ) . toMatchInlineSnapshot ( `
788
- "Error:
789
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
790
- 5 | export async function getServerSideProps() {
791
- 6 | setTimeout(() => {
792
- > 7 | throw new Error()
793
- | ^
794
- 8 | }, 10)
795
- 9 | return {
796
- 10 | props: {},
797
- ⨯ uncaughtException: Error:
798
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
799
- 5 | export async function getServerSideProps() {
800
- 6 | setTimeout(() => {
801
- > 7 | throw new Error()
802
- | ^
803
- 8 | }, 10)
804
- 9 | return {
805
- 10 | props: {},
806
- ⨯ uncaughtException: Error:
807
- at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
808
- 5 | export async function getServerSideProps() {
809
- 6 | setTimeout(() => {
810
- > 7 | throw new Error()
811
- | ^
812
- 8 | }, 10)
813
- 9 | return {
814
- 10 | props: {},"
790
+ "Error:
791
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
792
+ 5 | export async function getServerSideProps() {
793
+ 6 | setTimeout(() => {
794
+ > 7 | throw new Error()
795
+ | ^
796
+ 8 | }, 10)
797
+ 9 | return {
798
+ 10 | props: {},
799
+ ⨯ uncaughtException: Error:
800
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
801
+ 5 | export async function getServerSideProps() {
802
+ 6 | setTimeout(() => {
803
+ > 7 | throw new Error()
804
+ | ^
805
+ 8 | }, 10)
806
+ 9 | return {
807
+ 10 | props: {},
808
+ ⨯ uncaughtException: Error:
809
+ at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10)
810
+ 5 | export async function getServerSideProps() {
811
+ 6 | setTimeout(() => {
812
+ > 7 | throw new Error()
813
+ | ^
814
+ 8 | }, 10)
815
+ 9 | return {
816
+ 10 | props: {},"
815
817
` )
816
818
}
817
819
} )
0 commit comments