mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 02:22:14 +00:00
fix: cache build artefacts (#1091)
To speed up the build and make it more reliable, cache the node_modules folder, dist, etc and re-use on each step.
This commit is contained in:
parent
ef54e0a10e
commit
5043cd5643
300
.github/workflows/examples.yml
vendored
300
.github/workflows/examples.yml
vendored
@ -8,17 +8,59 @@ on:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
check:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: npx aegir lint
|
||||
- run: npx aegir ts -p check
|
||||
- run: npx aegir build
|
||||
test-auto-relay-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -27,8 +69,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- auto-relay
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- auto-relay
|
||||
test-chat-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -37,8 +96,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- chat
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- chat
|
||||
test-connection-encryption-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -47,8 +123,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- connection-encryption
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- connection-encryption
|
||||
test-discovery-mechanisms-example:
|
||||
needs: check
|
||||
runs-on: macos-latest
|
||||
@ -57,8 +150,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- discovery-mechanisms
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- discovery-mechanisms
|
||||
test-echo-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -67,8 +177,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- echo
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- echo
|
||||
test-libp2p-in-the-browser-example:
|
||||
needs: check
|
||||
runs-on: macos-latest
|
||||
@ -77,8 +204,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- libp2p-in-the-browser
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- libp2p-in-the-browser
|
||||
test-peer-and-content-routing-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -87,8 +231,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- peer-and-content-routing
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- peer-and-content-routing
|
||||
test-pnet-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -97,8 +258,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- pnet
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- pnet
|
||||
test-protocol-and-stream-muxing-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -107,8 +285,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- protocol-and-stream-muxing
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- protocol-and-stream-muxing
|
||||
test-pubsub-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -117,8 +312,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- pubsub
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- pubsub
|
||||
test-transports-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -127,8 +339,25 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- run: cd examples && npm i && npm run test -- transports
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- transports
|
||||
test-webrtc-direct-example:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
@ -137,5 +366,22 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install -g @mapbox/node-pre-gyp && npm install
|
||||
- run: cd examples && npm i && npm run test -- webrtc-direct
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
./examples/node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
cd examples && npm i
|
||||
- run: cd examples && npm run test -- webrtc-direct
|
||||
|
134
.github/workflows/main.yml
vendored
134
.github/workflows/main.yml
vendored
@ -8,21 +8,65 @@ on:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
node: [16]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
check:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npx aegir lint
|
||||
- run: npx aegir build
|
||||
- run: npx aegir dep-check
|
||||
- uses: ipfs/aegir/actions/bundle-size@master
|
||||
name: size
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
test-node:
|
||||
needs: check
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -36,7 +80,23 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
if: matrix.os != 'windows-latest'
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npm run test:node -- --cov --bail
|
||||
- uses: codecov/codecov-action@v1
|
||||
test-chrome:
|
||||
@ -47,7 +107,22 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: lts/*
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npm run test:browser -- -t browser -t webworker --bail
|
||||
test-firefox:
|
||||
needs: check
|
||||
@ -57,7 +132,22 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: lts/*
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npm run test:browser -- -t browser -t webworker --bail -- --browser firefox
|
||||
test-ts:
|
||||
needs: check
|
||||
@ -67,7 +157,22 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: lts/*
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npm run test:ts
|
||||
test-interop:
|
||||
needs: check
|
||||
@ -77,5 +182,20 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: lts/*
|
||||
- run: npm install
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
env:
|
||||
CACHE_NAME: cache-node-modules
|
||||
with:
|
||||
path: |
|
||||
~/.cache
|
||||
~/.npm
|
||||
./node_modules
|
||||
./dist
|
||||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- run: npm run test:interop -- --bail -- --exit
|
||||
|
@ -12,6 +12,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.13.10",
|
||||
"@babel/core": "^7.13.10",
|
||||
"@mapbox/node-pre-gyp": "^1.0.8",
|
||||
"babel-plugin-syntax-async-functions": "^6.13.0",
|
||||
"babel-plugin-transform-regenerator": "^6.26.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
|
@ -155,7 +155,7 @@
|
||||
"libp2p-floodsub": "^0.28.0",
|
||||
"libp2p-gossipsub": "^0.12.1",
|
||||
"libp2p-interfaces-compliance-tests": "^2.0.1",
|
||||
"libp2p-interop": "^0.5.0",
|
||||
"libp2p-interop": "^0.6.0",
|
||||
"libp2p-kad-dht": "^0.27.1",
|
||||
"libp2p-mdns": "^0.18.0",
|
||||
"libp2p-mplex": "^0.10.1",
|
||||
|
@ -75,11 +75,11 @@ describe('peer-routing', () => {
|
||||
it('should use the nodes dht', async () => {
|
||||
sinon.stub(nodes[0]._dht, 'findPeer').callsFake(async function * () {
|
||||
yield {
|
||||
name: 'PEER_RESPONSE',
|
||||
closer: [{
|
||||
name: 'FINAL_PEER',
|
||||
peer: {
|
||||
id: nodes[1].peerId,
|
||||
multiaddrs: []
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -448,10 +448,8 @@ describe('peer-routing', () => {
|
||||
|
||||
sinon.stub(node._dht, 'findPeer').callsFake(async function * () {
|
||||
yield {
|
||||
name: 'PEER_RESPONSE',
|
||||
closer: [
|
||||
result
|
||||
]
|
||||
name: 'FINAL_PEER',
|
||||
peer: result
|
||||
}
|
||||
})
|
||||
sinon.stub(delegate, 'findPeer').callsFake(async () => {
|
||||
@ -477,10 +475,8 @@ describe('peer-routing', () => {
|
||||
|
||||
sinon.stub(node._dht, 'findPeer').callsFake(async function * () {
|
||||
yield {
|
||||
name: 'PEER_RESPONSE',
|
||||
closer: [
|
||||
result
|
||||
]
|
||||
name: 'FINAL_PEER',
|
||||
peer: result
|
||||
}
|
||||
})
|
||||
sinon.stub(delegate, 'findPeer').callsFake(() => {})
|
||||
|
Loading…
x
Reference in New Issue
Block a user