Skip to content

Commit 9165c6b

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

16 files changed

+154
-22
lines changed

.pnp.cjs

Lines changed: 47 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:430f75057f3aabefdf9c2a631f85b94e4cb490e009981ee7eab9b7f5749b030e
3+
size 57153
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:f8e651b1438db6ecc26c3e8dbcb3eb99f3bc6b982871640d722a023fe7ebc67b
3+
size 388572
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3e6dc5d515a56c34ace4bdc67bb705ece1d52176b79ef5f186b0796ae2230f58
3+
size 50905
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:70476627eca6de83b93efacb70c8676343ee62d9cecf0b27e1b4d685b4a4a726
3+
size 233390
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 () => {

0 commit comments

Comments
 (0)