Skip to content

Commit 987e455

Browse files
committed
test: switch to js-ipfs for integration test
1 parent 784523b commit 987e455

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "merkling",
3-
"version": "2.0.0-alpha.6",
3+
"version": "2.0.0-alpha.7",
44
"description": "JS Object to IPLD mapping layer",
55
"homepage": "https://github.com/kanej/merkling",
66
"bugs": {
@@ -19,6 +19,7 @@
1919
"test:integration": "jest --detectOpenHandles --runInBand --config=jest.integration.json",
2020
"lint": "eslint --fix ./{src,test}/**/*.ts",
2121
"build": "tsc",
22+
"prepublish": "tsc",
2223
"dev": "webpack-dev-server --open",
2324
"docs-readme": "documentation readme --config documentation.yml --document-exported --section=API src/merkling.ts src/merklingSession.ts",
2425
"docs": "documentation build --format html --theme node_modules/clean-documentation-theme --o docs",

test/integration/helpers.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import ipfsClient from 'ipfs-http-client'
1+
import Ipfs from 'ipfs'
22

3-
export const setupIpfsNode = () => {
4-
return new Promise((resolve: Function) => {
5-
const ipfs = ipfsClient('/ip4/127.0.0.1/tcp/5001')
6-
return resolve(ipfs)
3+
export const setupIpfsNode = async () => {
4+
return Ipfs.create({
5+
repo: './.test-ipfs',
6+
silent: true,
7+
config: {
8+
Bootstrap: []
9+
}
710
})
811
}
912

1013
// eslint-disable-next-line
1114
export const shutdownIpfsNode = (node: any) => {
12-
return new Promise((resolve: Function) => {
13-
resolve()
14-
})
15+
return node.stop()
1516
}

0 commit comments

Comments
 (0)