@@ -6,12 +6,6 @@ import { JsonRpcClient, SimpleMessagingConnection } from "./jsonrpcclient";
66import { parseJsonRpcResponse } from "./parse" ;
77import { JsonRpcRequest , JsonRpcResponse } from "./types" ;
88
9- function pendingWithoutWorker ( ) : void {
10- if ( typeof Worker === "undefined" ) {
11- pending ( "Environment without WebWorker support detected. Marked as pending." ) ;
12- }
13- }
14-
159function makeSimpleMessagingConnection (
1610 worker : Worker ,
1711) : SimpleMessagingConnection < JsonRpcRequest , JsonRpcResponse > {
@@ -34,21 +28,17 @@ function makeSimpleMessagingConnection(
3428 } ;
3529}
3630
37- describe ( "JsonRpcClient" , ( ) => {
31+ ( typeof Worker !== "undefined" ? describe : xdescribe ) ( "JsonRpcClient" , ( ) => {
3832 const dummyserviceKarmaUrl = "/base/dist/web/dummyservice.worker.js" ;
3933
4034 it ( "can be constructed with a Worker" , ( ) => {
41- pendingWithoutWorker ( ) ;
42-
4335 const worker = new Worker ( dummyserviceKarmaUrl ) ;
4436 const client = new JsonRpcClient ( makeSimpleMessagingConnection ( worker ) ) ;
4537 expect ( client ) . toBeTruthy ( ) ;
4638 worker . terminate ( ) ;
4739 } ) ;
4840
4941 it ( "can communicate with worker" , async ( ) => {
50- pendingWithoutWorker ( ) ;
51-
5242 const worker = new Worker ( dummyserviceKarmaUrl ) ;
5343
5444 const client = new JsonRpcClient ( makeSimpleMessagingConnection ( worker ) ) ;
@@ -66,8 +56,6 @@ describe("JsonRpcClient", () => {
6656 } ) ;
6757
6858 it ( "supports params as dictionary" , async ( ) => {
69- pendingWithoutWorker ( ) ;
70-
7159 const worker = new Worker ( dummyserviceKarmaUrl ) ;
7260
7361 const client = new JsonRpcClient ( makeSimpleMessagingConnection ( worker ) ) ;
0 commit comments