Skip to content

Commit fb414b8

Browse files
committed
socket: process?.env
1 parent 5afe721 commit fb414b8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

packages/socket/src/queueingstreamingsocket.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { ConnectionStatus, QueueingStreamingSocket } from "./queueingstreamingsocket";
22

33
function pendingWithoutSocketServer(): void {
4-
if (!process.env.SOCKETSERVER_ENABLED) {
5-
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
4+
if (typeof process !== "undefined" && process?.env.SOCKETSERVER_ENABLED) {
5+
return;
66
}
7+
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
78
}
89

910
describe("QueueingStreamingSocket", () => {

packages/socket/src/reconnectingsocket.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ const getExec = async (): Promise<Exec | undefined> => {
1212
};
1313

1414
function pendingWithoutSocketServer(): void {
15-
if (!process.env.SOCKETSERVER_ENABLED) {
16-
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
15+
if (typeof process !== "undefined" && process?.env.SOCKETSERVER_ENABLED) {
16+
return;
1717
}
18+
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
1819
}
1920

2021
describe("ReconnectingSocket", () => {

packages/socket/src/socketwrapper.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { SocketWrapper } from "./socketwrapper";
22

33
function pendingWithoutSocketServer(): void {
4-
if (!process.env.SOCKETSERVER_ENABLED) {
5-
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
4+
if (typeof process !== "undefined" && process?.env.SOCKETSERVER_ENABLED) {
5+
return;
66
}
7+
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
78
}
89

910
describe("SocketWrapper", () => {

packages/socket/src/streamingsocket.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ import { toListPromise } from "@cosmjs/stream";
22

33
import { StreamingSocket } from "./streamingsocket";
44

5-
function skipTests(): boolean {
6-
return !process.env.SOCKETSERVER_ENABLED;
7-
}
8-
95
function pendingWithoutSocketServer(): void {
10-
if (skipTests()) {
11-
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
6+
if (typeof process !== "undefined" && process?.env.SOCKETSERVER_ENABLED) {
7+
return;
128
}
9+
pending("Set SOCKETSERVER_ENABLED to enable socket tests");
1310
}
1411

1512
describe("StreamingSocket", () => {

0 commit comments

Comments
 (0)