Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
run: npm ci
- name: npm run eslint
run: npm run eslint
- name: test-types
run: npm run test-types

test:
name: Test Unit using Node ${{ matrix.node-version }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"eslint": "eslint --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
"test": "jest --detectOpenHandles",
"test-unit": "jest test/unit --detectOpenHandles",
"test-types": "tsc --noEmit --project ./tsconfig.test.json",
"coverage": "jest --coverage",
"test-integration": "jest --forceExit test/integration",
"test-integration-no-resend": "jest --forceExit --testTimeout=10000 --testPathIgnorePatterns='resend|Resend' --testNamePattern='^((?!(resend|Resend|resent|Resent|gap|Gap)).)*$' test/integration/*.test.js",
Expand Down
177 changes: 105 additions & 72 deletions src/rest/DataUnionEndpoints.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/integration/dataunion/DataUnionEndpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('DataUnionEndPoints', () => {
const tokenMainnet = new Contract(config.clientOptions.tokenAddress, Token.abi, tokenAdminWallet)

afterAll(async () => {
await providerMainnet.removeAllListeners()
await providerSidechain.removeAllListeners()
providerMainnet.removeAllListeners()
providerSidechain.removeAllListeners()
await adminClient.ensureDisconnected()
})

const streamrClientCleanupList = []
const streamrClientCleanupList: StreamrClient[] = []
afterAll(async () => Promise.all(streamrClientCleanupList.map((c) => c.ensureDisconnected())))

beforeAll(async () => {
Expand All @@ -51,7 +51,7 @@ describe('DataUnionEndPoints', () => {

// fresh dataUnion for each test case, created NOT in parallel to avoid nonce troubles
const adminMutex = new Mutex()
async function deployDataUnionSync(testName) {
async function deployDataUnionSync(testName: string) {
let dataUnion: DataUnion
await adminMutex.runExclusive(async () => {
const dataUnionName = testName + Date.now()
Expand All @@ -74,7 +74,7 @@ describe('DataUnionEndPoints', () => {
}
)
})
return dataUnion
return dataUnion!
}

describe('Admin', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/dataunion/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const createMockAddress = () => '0x000000000000000000000000000' + Date.now()

describe('DataUnion deployment', () => {

let adminClient
let adminClient: StreamrClient

beforeAll(async () => {
log(`Connecting to Ethereum networks, config = ${JSON.stringify(config)}`)
Expand Down
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"moduleResolution": "node"
},
"include": ["src/**/*"],
"include": ["src/**/*", "contracts/*"],
"exclude": ["node_modules", "dist"]
}
}
5 changes: 5 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*", "contracts/**/*", "test/**/*"],
"exclude": ["node_modules", "dist", "test/legacy/*"]
}