Skip to content

Commit

Permalink
updated: bigint tests, setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Salmandabbakuti committed Nov 23, 2023
1 parent b35176a commit 417abb9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build & Test

on:
push:
branches: [main, develop, "feat/*"]
pull_request:
branches: [main, develop, "feat/*"]

jobs:
e2e-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x, 20.x, 21.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: "Install dependencies"
run: npm install
- name: "Run tests"
run: npm run test
- name: "Build the package"
run: npm run build --if-present
18 changes: 9 additions & 9 deletions test/superfluid-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ describe("SuperfluidPlugin Method Tests", () => {
const { lastUpdated, flowrate } = await cfav1Forwarder.methods
.getFlowInfo(token, sender, receiver)
.call();
expect(lastUpdated.toString()).to.be.a("string");
expect(flowrate.toString()).to.be.a("string");
expect(lastUpdated).to.be.a("bigint");
expect(flowrate).to.be.a("bigint");
});

it("should get flowrate with forwarder", async () => {
const flowrate = await cfav1Forwarder.methods
.getFlowrate(token, sender, receiver)
.call();
expect(flowrate.toString()).to.be.a("string");
expect(flowrate).to.be.a("bigint");
});

it("should get flow info with cfav1", async () => {
const { timestamp, flowRate } = await cfav1.methods
.getFlow(token, sender, receiver)
.call();
expect(timestamp.toString()).to.be.a("string");
expect(flowRate.toString()).to.be.a("string");
expect(timestamp).to.be.a("bigint");
expect(flowRate).to.be.a("bigint");
});

it("should get token IDA subscription details with idav1", async () => {
Expand All @@ -101,7 +101,7 @@ describe("SuperfluidPlugin Method Tests", () => {
.getSubscription(token, publisher, indexId, subscriber)
.call();
// expect to have units, exist, approved
expect(units.toString()).to.be.a("string");
expect(units).to.be.a("bigint");
expect(exist).to.be.a("boolean");
expect(approved).to.be.a("boolean");
});
Expand All @@ -115,10 +115,10 @@ describe("SuperfluidPlugin Method Tests", () => {
const { exist, indexValue, totalUnitsApproved, totalUnitsPending } =
await idav1.methods.getIndex(token, publisher, indexId).call();
// expect to have indexValue, exist, totalUnitsApproved, totalUnitsPending
expect(indexValue.toString()).to.be.a("string");
expect(indexValue).to.be.a("bigint");
expect(exist).to.be.a("boolean");
expect(totalUnitsApproved.toString()).to.be.a("string");
expect(totalUnitsPending.toString()).to.be.a("string");
expect(totalUnitsApproved).to.be.a("bigint");
expect(totalUnitsPending).to.be.a("bigint");
});

it("should check if address is trusted forwarder using host", async () => {
Expand Down

0 comments on commit 417abb9

Please sign in to comment.