You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
I am getting a segfault when I run the following unit test. The segfault doesn't happen every time I run the test. Any ideas?
vartest=require('tape');varlevel=require('level');varpath=require('path');varthrough2=require('through2');varJSONStream=require('JSONStream');functionpush(db){returnthrough2.obj(function(levelRequest,enc,cb){varself=this;db.put(levelRequest.key,levelRequest.value,{sync:true},function(error){if(error){console.log('encountered an error while putting '+JSON.stringify(levelRequest)+' on the database: '+error);self.push({result:'error',key: levelRequest.key,msg: error});}else{self.push({result:'success',key: levelRequest.key});}cb();});})}test('can push values through a level database',function(t){vardb=level('./test.db');vardbify=push(db);varstringify=JSONStream.stringify(false);dbify.pipe(stringify).pipe(process.stdout);dbify.write({key:'hi',value:"wisconsin"});db.close(function(er){if(er)thrower;t.end();})})