11// eslint-disable-next-line no-unused-vars
22import * as API from '../src/clock/api.js'
33import { advance , EventBlock , vis } from '../src/clock/index.js'
4- import { Blockstore , randomCID } from './helpers.js'
4+ import { Blockstore , randomCID , clockVis } from './helpers.js'
55
66async function randomEventData ( ) {
77 return {
@@ -19,7 +19,7 @@ describe('clock', () => {
1919 await blocks . put ( event . cid , event . bytes )
2020 const head = await advance ( blocks , [ ] , event . cid )
2121
22- for await ( const line of vis ( blocks , head ) ) console . log ( line )
22+ await clockVis ( blocks , head )
2323 assert . equal ( head . length , 1 )
2424 assert . equal ( head [ 0 ] . toString ( ) , event . cid . toString ( ) )
2525 } )
@@ -37,7 +37,7 @@ describe('clock', () => {
3737
3838 head = await advance ( blocks , head , event . cid )
3939
40- for await ( const line of vis ( blocks , head ) ) console . log ( line )
40+ await clockVis ( blocks , head )
4141 assert . equal ( head . length , 1 )
4242 assert . equal ( head [ 0 ] . toString ( ) , event . cid . toString ( ) )
4343 } )
@@ -59,7 +59,7 @@ describe('clock', () => {
5959 await blocks . put ( event1 . cid , event1 . bytes )
6060 head = await advance ( blocks , head , event1 . cid )
6161
62- for await ( const line of vis ( blocks , head ) ) console . log ( line )
62+ await clockVis ( blocks , head )
6363 assert . equal ( head . length , 2 )
6464 assert . equal ( head [ 0 ] . toString ( ) , event0 . cid . toString ( ) )
6565 assert . equal ( head [ 1 ] . toString ( ) , event1 . cid . toString ( ) )
@@ -94,7 +94,7 @@ describe('clock', () => {
9494 await blocks . put ( event4 . cid , event4 . bytes )
9595 head = await advance ( blocks , head , event4 . cid )
9696
97- for await ( const line of vis ( blocks , head ) ) console . log ( line )
97+ await clockVis ( blocks , head )
9898 assert . equal ( head . length , 2 )
9999 assert . equal ( head [ 0 ] . toString ( ) , event3 . cid . toString ( ) )
100100 assert . equal ( head [ 1 ] . toString ( ) , event4 . cid . toString ( ) )
@@ -137,7 +137,7 @@ describe('clock', () => {
137137 await blocks . put ( event5 . cid , event5 . bytes )
138138 head = await advance ( blocks , head , event5 . cid )
139139
140- for await ( const line of vis ( blocks , head ) ) console . log ( line )
140+ await clockVis ( blocks , head )
141141 assert . equal ( head . length , 1 )
142142 assert . equal ( head [ 0 ] . toString ( ) , event5 . cid . toString ( ) )
143143 } )
@@ -192,7 +192,7 @@ describe('clock', () => {
192192 head = await advance ( blocks , head , event6 . cid )
193193 assert . equal ( count - before , 10 )
194194
195- for await ( const line of vis ( blocks , head ) ) console . log ( line )
195+ await clockVis ( blocks , head )
196196 assert . equal ( head . length , 2 )
197197 assert . equal ( head [ 0 ] . toString ( ) , event5 . cid . toString ( ) )
198198 assert . equal ( head [ 1 ] . toString ( ) , event6 . cid . toString ( ) )
@@ -214,7 +214,7 @@ describe('clock', () => {
214214
215215 head = await advance ( blocks , head , event1 . cid )
216216
217- for await ( const line of vis ( blocks , head ) ) console . log ( line )
217+ await clockVis ( blocks , head )
218218 assert . equal ( head . length , 1 )
219219 assert . equal ( head [ 0 ] . toString ( ) , event1 . cid . toString ( ) )
220220 } )
0 commit comments