-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(indexer-nibi 99% coverage): coverage
- Loading branch information
Showing
33 changed files
with
1,034 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/indexer-nibi/src/batchHandlers/queryBatchHandler.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { queryBatchHandler } from "./queryBatchHandler" | ||
import { communityPoolQueryString } from "../query/communityPool" | ||
import { delegationsQueryString } from "../query" | ||
|
||
describe("queryBatchHandler tests", () => { | ||
test("queryBatchHandler", async () => { | ||
const resp = await queryBatchHandler( | ||
[ | ||
communityPoolQueryString({}, true), | ||
delegationsQueryString( | ||
{ | ||
limit: 1, | ||
}, | ||
true | ||
), | ||
], | ||
"https://hm-graphql.itn-3.nibiru.fi/query" | ||
) | ||
|
||
expect(resp).toHaveProperty("communityPool") | ||
expect(resp).toHaveProperty("delegations") | ||
|
||
if ((resp.communityPool?.length ?? 0) > 0) { | ||
const [communityPool] = resp.communityPool ?? [] | ||
const fields = ["amount", "denom"] | ||
fields.forEach((field: string) => { | ||
expect(communityPool).toHaveProperty(field) | ||
}) | ||
} | ||
|
||
if ((resp.delegations?.length ?? 0) > 0) { | ||
const [delegation] = resp.delegations ?? [] | ||
const fields = ["amount", "delegator", "validator"] | ||
fields.forEach((field: string) => { | ||
expect(delegation).toHaveProperty(field) | ||
}) | ||
} | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/indexer-nibi/src/graphql-codegen/codegen-loader.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { GraphQLSchema } from "graphql" | ||
|
||
const loader = require("./codegen-loader") | ||
|
||
describe("codegen-loader tests", () => { | ||
test("codegen-loader", async () => { | ||
const testResult = await loader() | ||
expect(testResult).toBeInstanceOf(GraphQLSchema) | ||
}) | ||
}) |
Oops, something went wrong.