File tree Expand file tree Collapse file tree 5 files changed +24
-15
lines changed
packages/nextjs/test/integration/test/server Expand file tree Collapse file tree 5 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const assert = require('assert');
33const { sleep } = require ( '../utils/common' ) ;
44const { getAsync, interceptEventRequest } = require ( '../utils/server' ) ;
55
6- module . exports = async ( { url, argv } ) => {
6+ module . exports = async ( { url : urlBase , argv } ) => {
7+ const url = `${ urlBase } /api/error` ;
8+
79 const capturedRequest = interceptEventRequest (
810 {
911 exception : {
@@ -18,15 +20,15 @@ module.exports = async ({ url, argv }) => {
1820 runtime : 'node' ,
1921 } ,
2022 request : {
21- url : ` ${ url } /api/error` ,
23+ url,
2224 method : 'GET' ,
2325 } ,
2426 transaction : 'GET /api/error' ,
2527 } ,
2628 argv ,
2729 ) ;
2830
29- await getAsync ( ` ${ url } /api/error` ) ;
31+ await getAsync ( url ) ;
3032 await sleep ( 100 ) ;
3133
3234 assert . ok ( capturedRequest . isDone ( ) , 'Did not intercept expected request' ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const assert = require('assert');
33const { sleep } = require ( '../utils/common' ) ;
44const { getAsync, interceptEventRequest } = require ( '../utils/server' ) ;
55
6- module . exports = async ( { url, argv } ) => {
6+ module . exports = async ( { url : urlBase , argv } ) => {
7+ const url = `${ urlBase } /withServerSideProps` ;
8+
79 const capturedRequest = interceptEventRequest (
810 {
911 exception : {
@@ -18,14 +20,14 @@ module.exports = async ({ url, argv }) => {
1820 runtime : 'node' ,
1921 } ,
2022 request : {
21- url : '/withServerSideProps' ,
23+ url,
2224 method : 'GET' ,
2325 } ,
2426 } ,
2527 argv ,
2628 ) ;
2729
28- await getAsync ( ` ${ url } /withServerSideProps` ) ;
30+ await getAsync ( url ) ;
2931 await sleep ( 100 ) ;
3032
3133 assert . ok ( capturedRequest . isDone ( ) , 'Did not intercept expected request' ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const assert = require('assert');
33const { sleep } = require ( '../utils/common' ) ;
44const { getAsync, interceptTracingRequest } = require ( '../utils/server' ) ;
55
6- module . exports = async ( { url, argv } ) => {
6+ module . exports = async ( { url : urlBase , argv } ) => {
7+ const url = `${ urlBase } /api/users` ;
8+
79 const capturedRequest = interceptTracingRequest (
810 {
911 contexts : {
@@ -16,13 +18,13 @@ module.exports = async ({ url, argv }) => {
1618 transaction : 'GET /api/users' ,
1719 type : 'transaction' ,
1820 request : {
19- url : '/api/users' ,
21+ url,
2022 } ,
2123 } ,
2224 argv ,
2325 ) ;
2426
25- await getAsync ( ` ${ url } /api/users` ) ;
27+ await getAsync ( url ) ;
2628 await sleep ( 100 ) ;
2729
2830 assert . ok ( capturedRequest . isDone ( ) , 'Did not intercept expected request' ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ const assert = require('assert');
33const { sleep } = require ( '../utils/common' ) ;
44const { getAsync, interceptTracingRequest } = require ( '../utils/server' ) ;
55
6- module . exports = async ( { url, argv } ) => {
6+ module . exports = async ( { url : urlBase , argv } ) => {
7+ const url = `${ urlBase } /api/broken` ;
78 const capturedRequest = interceptTracingRequest (
89 {
910 contexts : {
@@ -16,13 +17,13 @@ module.exports = async ({ url, argv }) => {
1617 transaction : 'GET /api/broken' ,
1718 type : 'transaction' ,
1819 request : {
19- url : '/api/broken' ,
20+ url,
2021 } ,
2122 } ,
2223 argv ,
2324 ) ;
2425
25- await getAsync ( ` ${ url } /api/broken` ) ;
26+ await getAsync ( url ) ;
2627 await sleep ( 100 ) ;
2728
2829 assert . ok ( capturedRequest . isDone ( ) , 'Did not intercept expected request' ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ const nock = require('nock');
55const { sleep } = require ( '../utils/common' ) ;
66const { getAsync, interceptTracingRequest } = require ( '../utils/server' ) ;
77
8- module . exports = async ( { url, argv } ) => {
8+ module . exports = async ( { url : urlBase , argv } ) => {
9+ const url = `${ urlBase } /api/http` ;
10+
911 nock ( 'http://example.com' )
1012 . get ( '/' )
1113 . reply ( 200 , 'ok' ) ;
@@ -30,13 +32,13 @@ module.exports = async ({ url, argv }) => {
3032 transaction : 'GET /api/http' ,
3133 type : 'transaction' ,
3234 request : {
33- url : '/api/http' ,
35+ url,
3436 } ,
3537 } ,
3638 argv ,
3739 ) ;
3840
39- await getAsync ( ` ${ url } /api/http` ) ;
41+ await getAsync ( url ) ;
4042 await sleep ( 100 ) ;
4143
4244 assert . ok ( capturedRequest . isDone ( ) , 'Did not intercept expected request' ) ;
You can’t perform that action at this time.
0 commit comments