@@ -10,6 +10,7 @@ import { getLogger } from '../shared/logger'
10
10
import { hasKey } from '../shared/utilities/tsUtils'
11
11
import { getTestWindow , printPendingUiElements } from './shared/vscode/window'
12
12
import { ToolkitError , formatError } from '../shared/errors'
13
+ import { proceedToBrowser } from '../auth/sso/model'
13
14
14
15
const runnableTimeout = Symbol ( 'runnableTimeout' )
15
16
@@ -56,8 +57,14 @@ export function setRunnableTimeout(test: Mocha.Runnable, maxTestDuration: number
56
57
}
57
58
58
59
export function skipTest ( testOrCtx : Mocha . Context | Mocha . Test | undefined , reason ?: string ) {
59
- const test =
60
- testOrCtx ?. type === 'test' ? ( testOrCtx as Mocha . Test ) : ( testOrCtx as Mocha . Context | undefined ) ?. currentTest
60
+ let test
61
+
62
+ if ( testOrCtx ?. type === 'test' ) {
63
+ test = ( testOrCtx as Mocha . Test )
64
+ } else {
65
+ const context = ( testOrCtx as Mocha . Context | undefined )
66
+ test = context ?. currentTest ?? context ?. test
67
+ }
61
68
62
69
if ( test ) {
63
70
test . title += ` (skipped${ reason ? ` - ${ reason } ` : '' } )`
@@ -203,7 +210,7 @@ function maskArns(text: string) {
203
210
*/
204
211
export function registerAuthHook ( secret : string , lambdaId = process . env [ 'AUTH_UTIL_LAMBDA_ARN' ] ) {
205
212
return getTestWindow ( ) . onDidShowMessage ( message => {
206
- if ( message . items [ 0 ] . title . match ( / C o p y C o d e / ) ) {
213
+ if ( message . items [ 0 ] . title . match ( new RegExp ( proceedToBrowser ) ) ) {
207
214
if ( ! lambdaId ) {
208
215
const baseMessage = 'Browser login flow was shown during testing without an authorizer function'
209
216
if ( process . env [ 'AWS_TOOLKIT_AUTOMATION' ] === 'local' ) {
0 commit comments