11const test = require ( 'brittle' )
2- const ram = require ( 'random-access-memory' )
2+ const RAM = require ( 'random-access-memory' )
33
44const Hypercore = require ( '../' )
55const { create, eventFlush } = require ( './helpers' )
@@ -71,7 +71,7 @@ test('close multiple', async function (t) {
7171} )
7272
7373test ( 'storage options' , async function ( t ) {
74- const core = new Hypercore ( { storage : ram } )
74+ const core = new Hypercore ( { storage : RAM } )
7575 await core . append ( 'hello' )
7676 t . alike ( await core . get ( 0 ) , Buffer . from ( 'hello' ) )
7777 t . end ( )
@@ -82,15 +82,15 @@ test(
8282 function ( t ) {
8383 const key = Buffer . alloc ( 33 ) . fill ( 'a' )
8484
85- const core = new Hypercore ( ram , key , { crypto : { } } )
85+ const core = new Hypercore ( RAM , key , { crypto : { } } )
8686
8787 t . is ( core . key , key )
8888 t . pass ( 'creating a core with more than 32 byteLength key did not throw' )
8989 }
9090)
9191
9292test ( 'createIfMissing' , async function ( t ) {
93- const core = new Hypercore ( ram , { createIfMissing : false } )
93+ const core = new Hypercore ( RAM , { createIfMissing : false } )
9494
9595 t . exception ( core . ready ( ) )
9696} )
@@ -114,15 +114,15 @@ test('reopen and overwrite', async function (t) {
114114
115115 function open ( name ) {
116116 if ( st [ name ] ) return st [ name ]
117- st [ name ] = ram ( )
117+ st [ name ] = new RAM ( )
118118 return st [ name ]
119119 }
120120} )
121121
122122test ( 'truncate event has truncated-length and fork' , async function ( t ) {
123123 t . plan ( 2 )
124124
125- const core = new Hypercore ( ram )
125+ const core = new Hypercore ( RAM )
126126
127127 core . on ( 'truncate' , function ( length , fork ) {
128128 t . is ( length , 2 )
@@ -134,7 +134,7 @@ test('truncate event has truncated-length and fork', async function (t) {
134134} )
135135
136136test ( 'treeHash gets the tree hash at a given core length' , async function ( t ) {
137- const core = new Hypercore ( ram )
137+ const core = new Hypercore ( RAM )
138138 await core . ready ( )
139139
140140 const { core : { tree } } = core
@@ -152,7 +152,7 @@ test('treeHash gets the tree hash at a given core length', async function (t) {
152152} )
153153
154154test ( 'snapshot locks the state' , async function ( t ) {
155- const core = new Hypercore ( ram )
155+ const core = new Hypercore ( RAM )
156156 await core . ready ( )
157157
158158 const a = core . snapshot ( )
@@ -173,7 +173,7 @@ test('snapshot locks the state', async function (t) {
173173test ( 'downloading local range' , async function ( t ) {
174174 t . plan ( 1 )
175175
176- const core = new Hypercore ( ram )
176+ const core = new Hypercore ( RAM )
177177
178178 await core . append ( 'a' )
179179
@@ -189,7 +189,7 @@ test('downloading local range', async function (t) {
189189test ( 'read ahead' , async function ( t ) {
190190 t . plan ( 1 )
191191
192- const core = new Hypercore ( ram , { valueEncoding : 'utf-8' } )
192+ const core = new Hypercore ( RAM , { valueEncoding : 'utf-8' } )
193193
194194 await core . append ( 'a' )
195195
0 commit comments