Skip to content

Commit c18db1c

Browse files
committed
test: fix test runners
1 parent f56025b commit c18db1c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"scripts": {
1919
"lint": "aegir lint",
2020
"build": "aegir build",
21-
"test": "aegir test -t node -f test/**/*.js",
22-
"test:node": "aegir test -t node -f test/**/*.js",
21+
"test": "aegir test -t node -f test/*.js test/**/*.js",
22+
"test:node": "aegir test -t node -f test/*.js test/**/*.js",
2323
"release": "aegir release --no-build -t node",
2424
"release-minor": "aegir release --no-build --type minor -t node",
2525
"release-major": "aegir release --no-build --type major -t node"

test/daemon/config.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const ma = require('multiaddr')
1111
const { createDaemon } = require('../../src/daemon')
1212
const { isWindows } = require('../../src/util')
1313

14-
const PATH = isWindows
15-
? path.join('\\\\?\\pipe', '/tmp/p2pd.sock')
16-
: path.resolve(os.tmpdir(), '/tmp/p2pd.sock')
14+
const daemonAddr = isWindows
15+
? ma('/ip4/0.0.0.0/tcp/8080')
16+
: ma(`/unix${path.resolve(os.tmpdir(), '/tmp/p2pd.sock')}`)
1717

1818
describe('configuration', () => {
1919
let daemon
@@ -32,7 +32,7 @@ describe('configuration', () => {
3232
dht: true,
3333
dhtClient: false,
3434
connMgr: false,
35-
listen: `/unix${PATH}`,
35+
listen: daemonAddr.toString(),
3636
id: '',
3737
bootstrapPeers: ''
3838
})

test/protocol.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
const chai = require('chai')
55
const expect = chai.expect
66

7-
const path = require('path')
8-
97
const multiaddr = require('multiaddr')
108

119
const {
@@ -61,7 +59,7 @@ describe('protocol', () => {
6159

6260
it('should be able to encode/decode a StreamHandlerRequest', () => {
6361
const streamHandlerRequest = {
64-
path: path.resolve('/tmp/p2p.sock'),
62+
addr: multiaddr('/unix/tmp/p2p.sock').buffer,
6563
proto: ['/p2pdaemon/1.0.0']
6664
}
6765
const request = {

0 commit comments

Comments
 (0)