@@ -37,6 +37,7 @@ import { DEFAULT_REGION } from '../helpers/constants'
3737import { cased } from '../sourcegen'
3838import { shellQuote } from '../services/shell'
3939import { Runtime } from '../runtimes'
40+ import { PlaywrightCheckLocalBundle } from '../constructs/playwright-check-bundle'
4041
4142export default class PwTestCommand extends AuthCommand {
4243 static coreCommand = true
@@ -243,6 +244,31 @@ export default class PwTestCommand extends AuthCommand {
243244 }
244245 } ) ( )
245246
247+ const bundledChecksByType = {
248+ playwright : [ ] as string [ ] ,
249+ }
250+
251+ for ( const [ logicalId , { bundle } ] of Object . entries ( projectBundle . data . check ) ) {
252+ if ( bundle instanceof PlaywrightCheckLocalBundle ) {
253+ bundledChecksByType . playwright . push ( logicalId )
254+ }
255+ }
256+
257+ if ( bundledChecksByType . playwright . length ) {
258+ this . style . actionStart ( 'Uploading Playwright code bundles' )
259+ try {
260+ for ( const logicalId of bundledChecksByType . playwright ) {
261+ const resourceData = projectBundle . data . check [ logicalId ]
262+ const bundle = resourceData . bundle as PlaywrightCheckLocalBundle
263+ resourceData . bundle = await bundle . store ( )
264+ }
265+ this . style . actionSuccess ( )
266+ } catch ( err ) {
267+ this . style . actionFailure ( )
268+ throw err
269+ }
270+ }
271+
246272 const checkBundles = Object . values ( projectBundle . data . check )
247273
248274 if ( ! checkBundles . length ) {
0 commit comments