File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
packages/npm-packages/ruby-wasm-wasi/test-e2e/examples Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11import { test , expect , Page } from '@playwright/test' ;
22import path from "path"
33import { waitForRubyVM , setupDebugLog , setupProxy } from "../support"
4+ import { readFileSync } from 'fs' ;
5+ import http from 'http' ;
6+ import https from 'https' ;
47
58test . beforeEach ( async ( { context } ) => {
69 setupDebugLog ( context ) ;
710 if ( process . env . RUBY_NPM_PACKAGE_ROOT ) {
811 setupProxy ( context ) ;
912 } else {
10- console . info ( "Testing against CDN deployed files" )
13+ console . info ( "Testing against CDN deployed files" ) ;
14+ const packagePath = path . join ( __dirname , ".." , ".." , "package.json" )
15+ const packageInfo = JSON . parse ( readFileSync ( packagePath , "utf-8" ) )
16+ const version = packageInfo . version
17+ const url = `https://registry.npmjs.org/ruby-head-wasm-wasi/${ version } `
18+ const response = await new Promise < http . IncomingMessage > ( ( resolve , reject ) => {
19+ https . get ( url , resolve ) . on ( "error" , reject )
20+ } )
21+ if ( response . statusCode == 404 ) {
22+ console . log ( `ruby-head-wasm-wasi@${ version } is not published yet, so skipping CDN tests` ) ;
23+ test . skip ( ) ;
24+ }
1125 }
1226} )
1327
You can’t perform that action at this time.
0 commit comments