Skip to content

Commit db10806

Browse files
committed
tendermint-rpc: revert to jasmine
1 parent 31a1bc4 commit db10806

19 files changed

+157
-24
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/comet1/comet1client.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
858858
});
859859
}
860860

861-
(tendermintEnabled ? describe : describe.skip)("Comet1Client with CometBFT 1 backend", () => {
861+
(tendermintEnabled ? describe : xdescribe)("Comet1Client with CometBFT 1 backend", () => {
862862
const { url, expected } = tendermintInstances[1];
863863

864864
it("can connect to a given url", async () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
847847
});
848848
}
849849

850-
(tendermintEnabled ? describe : describe.skip)("Comet38Client with CometBFT 0.38 backend", () => {
850+
(tendermintEnabled ? describe : xdescribe)("Comet38Client with CometBFT 0.38 backend", () => {
851851
const { url, expected } = tendermintInstances[38];
852852

853853
it("can connect to a given url", async () => {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const tendermintUrl = defaultInstance.url;
88
const echoUrl = "http://localhost:5555/echo_headers";
99

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

16-
(httpServerEnabled ? it : it.skip)("can POST to echo server", async () => {
16+
(httpServerEnabled ? it : xit)("can POST to echo server", async () => {
1717
const response = await http("POST", echoUrl, undefined, createJsonRpcRequest("health"));
1818
expect(response).toEqual({
1919
request_headers: jasmine.objectContaining({
@@ -24,12 +24,12 @@ describe("http", () => {
2424
});
2525

2626
it("errors for non-open port", async () => {
27-
await expect(
27+
await expectAsync(
2828
http("POST", `http://localhost:56745`, undefined, createJsonRpcRequest("health")),
29-
).rejects.toThrowError(/(ECONNREFUSED|Failed to fetch|fetch failed|(request to .* failed))/i);
29+
).toBeRejectedWithError(/(ECONNREFUSED|Failed to fetch|fetch failed|(request to .* failed))/i);
3030
});
3131

32-
(httpServerEnabled ? it : it.skip)("can POST to echo server with custom headers", async () => {
32+
(httpServerEnabled ? it : xit)("can POST to echo server with custom headers", async () => {
3333
// With custom headers
3434
const response = await http(
3535
"POST",

0 commit comments

Comments
 (0)