This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-53
lines changed Expand file tree Collapse file tree 3 files changed +11
-53
lines changed Original file line number Diff line number Diff line change 4
4
5
5
const PeerId = require ( 'peer-id' )
6
6
7
- const { spawnNodeWithId } = require ( '../utils/spawn' )
8
7
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
9
8
10
9
module . exports = ( createCommon , options ) => {
@@ -16,26 +15,12 @@ module.exports = (createCommon, options) => {
16
15
let ipfs
17
16
let nodeId
18
17
19
- before ( function ( done ) {
20
- // CI takes longer to instantiate the daemon, so we need to increase the
21
- // timeout for the before step
22
- this . timeout ( 60 * 1000 )
23
-
24
- common . setup ( ( err , factory ) => {
25
- expect ( err ) . to . not . exist ( )
26
-
27
- spawnNodeWithId ( factory , ( err , node ) => {
28
- expect ( err ) . to . not . exist ( )
29
-
30
- ipfs = node
31
- nodeId = node . peerId . id
32
-
33
- done ( )
34
- } )
35
- } )
18
+ before ( async ( ) => {
19
+ ipfs = await common . setup ( )
20
+ nodeId = ipfs . peerId . id
36
21
} )
37
22
38
- after ( ( done ) => common . teardown ( done ) )
23
+ after ( ( ) => common . teardown ( ) )
39
24
40
25
it ( 'should return false when the name that is intended to cancel is not subscribed' , async function ( ) {
41
26
this . timeout ( 60 * 1000 )
Original file line number Diff line number Diff line change 1
1
/* eslint-env mocha */
2
2
'use strict'
3
3
4
- const { spawnNodeWithId } = require ( '../utils/spawn' )
5
4
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
6
5
7
6
module . exports = ( createCommon , options ) => {
@@ -10,26 +9,14 @@ module.exports = (createCommon, options) => {
10
9
const common = createCommon ( )
11
10
12
11
describe ( '.name.pubsub.state' , function ( ) {
12
+ this . timeout ( 60 * 1000 )
13
13
let ipfs
14
14
15
- before ( function ( done ) {
16
- // CI takes longer to instantiate the daemon, so we need to increase the
17
- // timeout for the before step
18
- this . timeout ( 60 * 1000 )
19
-
20
- common . setup ( ( err , factory ) => {
21
- expect ( err ) . to . not . exist ( )
22
-
23
- spawnNodeWithId ( factory , ( err , node ) => {
24
- expect ( err ) . to . not . exist ( )
25
-
26
- ipfs = node
27
- done ( )
28
- } )
29
- } )
15
+ before ( async ( ) => {
16
+ ipfs = await common . setup ( )
30
17
} )
31
18
32
- after ( ( done ) => common . teardown ( done ) )
19
+ after ( ( ) => common . teardown ( ) )
33
20
34
21
it ( 'should get the current state of pubsub' , async function ( ) {
35
22
this . timeout ( 50 * 1000 )
Original file line number Diff line number Diff line change 2
2
/* eslint-env mocha */
3
3
'use strict'
4
4
5
- const { spawnNodeWithId } = require ( '../utils/spawn' )
6
5
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
7
6
8
7
module . exports = ( createCommon , options ) => {
@@ -13,24 +12,11 @@ module.exports = (createCommon, options) => {
13
12
describe ( '.name.pubsub.subs' , function ( ) {
14
13
let ipfs
15
14
16
- before ( function ( done ) {
17
- // CI takes longer to instantiate the daemon, so we need to increase the
18
- // timeout for the before step
19
- this . timeout ( 60 * 1000 )
20
-
21
- common . setup ( ( err , factory ) => {
22
- expect ( err ) . to . not . exist ( )
23
-
24
- spawnNodeWithId ( factory , ( err , node ) => {
25
- expect ( err ) . to . not . exist ( )
26
-
27
- ipfs = node
28
- done ( )
29
- } )
30
- } )
15
+ before ( async ( ) => {
16
+ ipfs = await common . setup ( )
31
17
} )
32
18
33
- after ( ( done ) => common . teardown ( done ) )
19
+ after ( ( ) => common . teardown ( ) )
34
20
35
21
it ( 'should get an empty array as a result of subscriptions before any resolve' , async function ( ) {
36
22
this . timeout ( 60 * 1000 )
You can’t perform that action at this time.
0 commit comments