File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11import { expect , test } from "@playwright/test" ;
22import { REPLAY_NEXTJS_PORT , getBaseUrl , waitMs } from "./util" ;
33
4- test ( 'should replay front-end bug in nextjs example' , async ( { page } ) => {
4+ test . only ( 'should replay front-end bug in nextjs example' , async ( { page } ) => {
55 // const capturesBefore = await fetchCaptures('sk_Y8dYLe5VoNJfDI_CPEqF8AqMTEwWAvTwBi7Ml-pN9bzWsgsP');
66 // Start from the index page (the baseURL is set via the webServer in the playwright.config.ts)
77 await page . goto ( getBaseUrl ( REPLAY_NEXTJS_PORT ) ) ;
Original file line number Diff line number Diff line change @@ -25,8 +25,10 @@ export async function request<DataType = unknown>(
2525 ...( options . headers && { headers : options . headers } ) ,
2626 body
2727 } )
28- if ( data . status >= 400 && data . status < 600 ) throw await data . text ( )
29- return Ok ( data . json ( ) as DataType )
28+ if ( data . status >= 400 && data . status < 600 ) {
29+ throw await data . text ( )
30+ }
31+ return Ok ( ( await data . json ( ) ) as DataType )
3032 } catch ( error ) {
3133 return Err (
3234 createHumanLog ( {
Original file line number Diff line number Diff line change @@ -135,6 +135,8 @@ export type FlytrapConfig = {
135135 /**
136136 * Use Flytrap in environments with access to only browser APIs, eg. Cloudflare
137137 * Workers & Pages and Deno Deploy.
138+ *
139+ * @deprecated Starting from v0.8 the Flytrap SDK only uses browser & edge-friendly APIs, meaning that the `browser` option is no longer needed.
138140 */
139141 browser ?: true
140142 transformOptions ?: {
Original file line number Diff line number Diff line change @@ -67,14 +67,14 @@ export function addMissingFlytrapImports(
6767 s . appendLeft (
6868 startingIndex ,
6969 `\n\nconst { ${ importsToBeAdded . join ( ', ' ) } } = require('${ FLYTRAP_PACKAGE_NAME } ${
70- config ?. browser === true ? '/browser ' : ''
70+ config ?. mode === 'replay' ? '/replay ' : ''
7171 } ');\n\n`
7272 )
7373 } else {
7474 s . appendLeft (
7575 startingIndex ,
7676 `\n\nimport { ${ importsToBeAdded . join ( ', ' ) } } from '${ FLYTRAP_PACKAGE_NAME } ${
77- config ?. browser === true ? '/browser ' : ''
77+ config ?. mode === 'replay' ? '/replay ' : ''
7878 } ';\n\n`
7979 )
8080 }
You can’t perform that action at this time.
0 commit comments