Skip to content

Commit 4382591

Browse files
committed
tendermint-rpc: revert to jasmine
1 parent 0e87bd9 commit 4382591

File tree

10 files changed

+57
-19
lines changed

10 files changed

+57
-19
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
if (process.env.SES_ENABLED) {
2+
require("ses");
3+
// eslint-disable-next-line no-undef
4+
lockdown();
5+
}
6+
7+
require("source-map-support").install();
8+
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
9+
10+
// setup Jasmine
11+
const Jasmine = require("jasmine");
12+
const jasmine = new Jasmine();
13+
jasmine.loadConfig({
14+
spec_dir: "build",
15+
spec_files: ["**/*.spec.js"],
16+
helpers: [],
17+
random: false,
18+
seed: null,
19+
stopSpecOnExpectationFailure: false,
20+
});
21+
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 15 * 1000;
22+
23+
// setup reporter
24+
const { SpecReporter } = require("jasmine-spec-reporter");
25+
const reporter = new SpecReporter({
26+
...defaultSpecReporterConfig,
27+
spec: {
28+
...defaultSpecReporterConfig.spec,
29+
displaySuccessful: !process.argv.includes("--quiet"),
30+
},
31+
});
32+
33+
// initialize and execute
34+
jasmine.env.clearReporters();
35+
jasmine.addReporter(reporter);
36+
void jasmine.execute();

packages/tendermint-rpc/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"docs": "typedoc",
3131
"format": "prettier --write --log-level warn \"./src/**/*.ts\"",
3232
"format-text": "prettier --write \"./*.md\"",
33-
"test-node": "vitest run --globals",
33+
"test-node": "yarn node jasmine-testrunner.cjs",
3434
"test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox karma.conf.cjs",
3535
"test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless karma.conf.cjs",
3636
"test": "yarn build-or-skip && yarn test-node",
@@ -52,11 +52,14 @@
5252
},
5353
"devDependencies": {
5454
"@istanbuljs/nyc-config-typescript": "^1.0.1",
55+
"@types/jasmine": "^4",
5556
"@types/karma-firefox-launcher": "^2",
5657
"@types/karma-jasmine": "^4",
5758
"@types/karma-jasmine-html-reporter": "^1",
5859
"@types/node": "*",
5960
"glob": "^11",
61+
"jasmine": "^4",
62+
"jasmine-spec-reporter": "^6",
6063
"karma": "^6.3.14",
6164
"karma-chrome-launcher": "^3.1.0",
6265
"karma-firefox-launcher": "^2.1.0",
@@ -68,7 +71,6 @@
6871
"source-map-support": "^0.5.19",
6972
"typedoc": "^0.28",
7073
"typescript": "~5.9",
71-
"vitest": "^3.2.4",
7274
"webpack": "^5.76.0",
7375
"webpack-cli": "^4.6.0"
7476
}

packages/tendermint-rpc/src/comet38/comet38client.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
854854
describe("Comet38Client with CometBFT 0.38 backend", () => {
855855
const { url, expected } = tendermintInstances[38];
856856

857-
(tendermintEnabled ? it : it.skip)("can connect to a given url", async () => {
857+
(tendermintEnabled ? it : xit)("can connect to a given url", async () => {
858858
// http connection
859859
{
860860
const client = await Comet38Client.connect("http://" + url);
@@ -872,11 +872,11 @@ describe("Comet38Client with CometBFT 0.38 backend", () => {
872872
}
873873
});
874874

875-
(tendermintEnabled ? describe : describe.skip)("With HttpClient", () => {
875+
(tendermintEnabled ? describe : xdescribe)("With HttpClient", () => {
876876
defaultTestSuite(() => new HttpClient("http://" + url), expected);
877877
});
878878

879-
(tendermintEnabled ? describe : describe.skip)("With WebsocketClient", () => {
879+
(tendermintEnabled ? describe : xdescribe)("With WebsocketClient", () => {
880880
// don't print out WebSocket errors if marked pending
881881
const onError = globalThis.process?.env.TENDERMINT_ENABLED ? console.error : () => 0;
882882
const factory = (): WebsocketClient => new WebsocketClient("ws://" + url, onError);
@@ -888,7 +888,7 @@ describe("Comet38Client with CometBFT 0.38 backend", () => {
888888
describe("Comet38Client with CometBFT 1 backend", () => {
889889
const { url, expected } = tendermintInstances[1];
890890

891-
(tendermintEnabled ? it : it.skip)("can connect to a given url", async () => {
891+
(tendermintEnabled ? it : xit)("can connect to a given url", async () => {
892892
// http connection
893893
{
894894
const client = await Comet38Client.connect("http://" + url);
@@ -906,11 +906,11 @@ describe("Comet38Client with CometBFT 1 backend", () => {
906906
}
907907
});
908908

909-
(tendermintEnabled ? describe : describe.skip)("With HttpClient", () => {
909+
(tendermintEnabled ? describe : xdescribe)("With HttpClient", () => {
910910
defaultTestSuite(() => new HttpClient("http://" + url), expected);
911911
});
912912

913-
(tendermintEnabled ? describe : describe.skip)("With WebsocketClient", () => {
913+
(tendermintEnabled ? describe : xdescribe)("With WebsocketClient", () => {
914914
// don't print out WebSocket errors if marked pending
915915
const onError = globalThis.process?.env.TENDERMINT_ENABLED ? console.error : () => 0;
916916
const factory = (): WebsocketClient => new WebsocketClient("ws://" + url, onError);

packages/tendermint-rpc/src/rpcclients/http.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const tendermintUrl = defaultInstance.url;
1313
const echoUrl = "http://localhost:5555/echo_headers";
1414

1515
describe("http", () => {
16-
(tendermintEnabled ? it : it.skip)("can send a health request", async () => {
16+
(tendermintEnabled ? it : xit)("can send a health request", async () => {
1717
const response = await http("POST", `http://${tendermintUrl}`, undefined, createJsonRpcRequest("health"));
1818
expect(response).toEqual(jasmine.objectContaining({ jsonrpc: "2.0" }));
1919
});

packages/tendermint-rpc/src/rpcclients/httpbatchclient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createJsonRpcRequest } from "../jsonrpc";
22
import { defaultInstance, tendermintEnabled } from "../testutil.spec";
33
import { HttpBatchClient } from "./httpbatchclient";
44

5-
(tendermintEnabled ? describe : describe.skip)("HttpBatchClient", () => {
5+
(tendermintEnabled ? describe : xdescribe)("HttpBatchClient", () => {
66
const tendermintUrl = "http://" + defaultInstance.url;
77

88
it("can make a simple call", async () => {

packages/tendermint-rpc/src/rpcclients/httpclient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createJsonRpcRequest } from "../jsonrpc";
22
import { defaultInstance, tendermintEnabled } from "../testutil.spec";
33
import { HttpClient } from "./httpclient";
44

5-
(tendermintEnabled ? describe : describe.skip)("HttpClient", () => {
5+
(tendermintEnabled ? describe : xdescribe)("HttpClient", () => {
66
const tendermintUrl = "http://" + defaultInstance.url;
77

88
it("can make a simple call", async () => {

packages/tendermint-rpc/src/rpcclients/rpcclient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HttpClient } from "./httpclient";
44
import { hasProtocol, instanceOfRpcStreamingClient } from "./rpcclient";
55
import { WebsocketClient } from "./websocketclient";
66

7-
(tendermintEnabled ? describe : describe.skip)("RpcClient", () => {
7+
(tendermintEnabled ? describe : xdescribe)("RpcClient", () => {
88
const httpUrl = "http://" + defaultInstance.url;
99
const wsUrl = "ws://" + defaultInstance.url;
1010

packages/tendermint-rpc/src/rpcclients/websocketclient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { defaultInstance, tendermintEnabled } from "../testutil.spec";
77
import { SubscriptionEvent } from "./rpcclient";
88
import { WebsocketClient } from "./websocketclient";
99

10-
(tendermintEnabled ? describe : describe.skip)("WebsocketClient", () => {
10+
(tendermintEnabled ? describe : xdescribe)("WebsocketClient", () => {
1111
const { blockTime, url } = defaultInstance;
1212
const tendermintUrl = "ws://" + url;
1313

packages/tendermint-rpc/src/tendermint34/tendermint34client.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
849849
describe("Tendermint34Client", () => {
850850
const { url, expected } = tendermintInstances[34];
851851

852-
(tendermintEnabled ? it : it.skip)("can connect to a given url", async () => {
852+
(tendermintEnabled ? it : xit)("can connect to a given url", async () => {
853853
// http connection
854854
{
855855
const client = await Tendermint34Client.connect("http://" + url);
@@ -867,11 +867,11 @@ describe("Tendermint34Client", () => {
867867
}
868868
});
869869

870-
(tendermintEnabled ? describe : describe.skip)("With HttpClient", () => {
870+
(tendermintEnabled ? describe : xdescribe)("With HttpClient", () => {
871871
defaultTestSuite(() => new HttpClient("http://" + url), expected);
872872
});
873873

874-
(tendermintEnabled ? describe : describe.skip)("With WebsocketClient", () => {
874+
(tendermintEnabled ? describe : xdescribe)("With WebsocketClient", () => {
875875
// don't print out WebSocket errors if marked pending
876876
const onError = globalThis.process?.env.TENDERMINT_ENABLED ? console.error : () => 0;
877877
const factory = (): WebsocketClient => new WebsocketClient("ws://" + url, onError);

packages/tendermint-rpc/src/tendermint37/tendermint37client.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
851851
describe("Tendermint37Client", () => {
852852
const { url, expected } = tendermintInstances[37];
853853

854-
(tendermintEnabled ? it : it.skip)("can connect to a given url", async () => {
854+
(tendermintEnabled ? it : xit)("can connect to a given url", async () => {
855855
// http connection
856856
{
857857
const client = await Tendermint37Client.connect("http://" + url);
@@ -869,11 +869,11 @@ describe("Tendermint37Client", () => {
869869
}
870870
});
871871

872-
(tendermintEnabled ? describe : describe.skip)("With HttpClient", () => {
872+
(tendermintEnabled ? describe : xdescribe)("With HttpClient", () => {
873873
defaultTestSuite(() => new HttpClient("http://" + url), expected);
874874
});
875875

876-
(tendermintEnabled ? describe : describe.skip)("With WebsocketClient", () => {
876+
(tendermintEnabled ? describe : xdescribe)("With WebsocketClient", () => {
877877
// don't print out WebSocket errors if marked pending
878878
const onError = globalThis.process?.env.TENDERMINT_ENABLED ? console.error : () => 0;
879879
const factory = (): WebsocketClient => new WebsocketClient("ws://" + url, onError);

0 commit comments

Comments
 (0)