@@ -17,15 +17,14 @@ test('syncing @comapeo/
[email protected] with the current version', async (t) => {
17
17
const newManager = createManager ( 'new' , t )
18
18
await newManager . setDeviceInfo ( { name : 'new' , deviceType : 'desktop' } )
19
19
20
- const managers = [ oldManager , newManager ]
21
-
22
- const disconnect = connectPeers ( managers )
20
+ const disconnect = connectPeers ( [ oldManager , newManager ] )
23
21
t . after ( disconnect )
24
- await waitForPeers ( managers )
22
+ await waitForPeers ( [ oldManager , newManager ] )
25
23
26
- const [ oldManagerPeers , newManagerPeers ] = await Promise . all (
27
- managers . map ( ( manager ) => manager . listLocalPeers ( ) )
28
- )
24
+ const [ oldManagerPeers , newManagerPeers ] = await Promise . all ( [
25
+ oldManager . listLocalPeers ( ) ,
26
+ newManager . listLocalPeers ( ) ,
27
+ ] )
29
28
assert . equal ( oldManagerPeers . length , 1 , 'old manager sees 1 peer' )
30
29
assert . equal ( newManagerPeers . length , 1 , 'new manager sees 1 peer' )
31
30
assert (
@@ -45,10 +44,11 @@ test('syncing @comapeo/
[email protected] with the current version', async (t) => {
45
44
invitees : [ newManager ] ,
46
45
} )
47
46
48
- const projects = await Promise . all (
49
- managers . map ( ( manager ) => manager . getProject ( projectId ) )
50
- )
51
- const [ oldProject , newProject ] = projects
47
+ const [ oldProject , newProject ] = await Promise . all ( [
48
+ oldManager . getProject ( projectId ) ,
49
+ newManager . getProject ( projectId ) ,
50
+ ] )
51
+
52
52
assert . equal (
53
53
( await newProject . $getProjectSettings ( ) ) . name ,
54
54
'foo bar' ,
@@ -58,15 +58,15 @@ test('syncing @comapeo/
[email protected] with the current version', async (t) => {
58
58
oldProject . $sync . start ( )
59
59
newProject . $sync . start ( )
60
60
61
- const [ oldObservation , newObservation ] = await Promise . all (
62
- projects . map ( ( project ) =>
63
- project . observation . create ( valueOf ( generate ( 'observation' ) [ 0 ] ) )
64
- )
65
- )
61
+ const [ oldObservation , newObservation ] = await Promise . all ( [
62
+ oldProject . observation . create ( valueOf ( generate ( 'observation' ) [ 0 ] ) ) ,
63
+ newProject . observation . create ( valueOf ( generate ( 'observation' ) [ 0 ] ) ) ,
64
+ ] )
66
65
67
- await Promise . all (
68
- projects . map ( ( project ) => project . $sync . waitForSync ( 'full' ) )
69
- )
66
+ await Promise . all ( [
67
+ oldProject . $sync . waitForSync ( 'full' ) ,
68
+ newProject . $sync . waitForSync ( 'full' ) ,
69
+ ] )
70
70
71
71
assert (
72
72
await oldProject . observation . getByDocId ( newObservation . docId ) ,
0 commit comments