File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ describe('E2E: My Test', () => {
122122 handleEvent: collector .handleEvent ,
123123 })
124124
125- if ( isAuthError ( result .output )) return
125+ assertNoAuthError ( result .output )
126126
127127 expect (result .output .type ).not .toBe (' error' )
128128 }, DEFAULT_TIMEOUT )
Original file line number Diff line number Diff line change @@ -80,3 +80,12 @@ export function isNetworkError(output: {
8080 const msg = output . message ?. toLowerCase ( ) ?? ''
8181 return output . errorCode === 'NETWORK_ERROR' || msg . includes ( 'network error' )
8282}
83+
84+ /**
85+ * Throw when an auth error is encountered so tests fail loudly.
86+ */
87+ export function assertNoAuthError ( output : { type : string ; message ?: string } ) : void {
88+ if ( isAuthError ( output ) ) {
89+ throw new Error ( `Unexpected auth error during e2e: ${ output . message || 'unknown error' } ` )
90+ }
91+ }
You can’t perform that action at this time.
0 commit comments