Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypher-stream

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypher-stream - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

3

index.js

@@ -9,2 +9,5 @@ var oboe = require('oboe');

function extractData(item) {
if(!item) {
return item;
}
if(item.data) {

@@ -11,0 +14,0 @@ return extractData(item.data);

2

package.json
{
"name": "cypher-stream",
"version": "0.1.7",
"version": "0.1.8",
"description": "Streams cypher query results in a clean format",

@@ -5,0 +5,0 @@ "main": "index.js",

var should = require('should');
var cypher = require('../index')('http://localhost:7474');
function shouldNotError(error) {
should.not.exist(error);
}
describe('Cypher stream', function () {
before(function (done){
this.timeout(3000); // sometimes travis ci takes too long here
this.timeout(5000); // sometimes travis ci takes too long here
cypher('FOREACH (x IN range(1,10) | CREATE(:Test {test: true}))')
.on('end', done)
.on('error', function (error){
console.error(error);
})
.on('error', shouldNotError)
.resume();

@@ -17,2 +19,3 @@ });

.on('end', done)
.on('error', shouldNotError)
.resume();

@@ -26,4 +29,5 @@ });

results++;
result.n.test.should.be.ok;
result.should.eql({ n: { test: true } });
})
.on('error', shouldNotError)
.on('end', function() {

@@ -38,2 +42,3 @@ results.should.eql(10);

var errored = false;
cypher('invalid query')

@@ -56,4 +61,5 @@ .on('error', function (error) {

it('handles non-neo4j errors', function (done) {
var errored = false;
var errored = false;
var expectedError = new Error('Test');
cypher('match (n:Test) return n limit 1')

@@ -71,3 +77,2 @@ .on('data', function () {

})
.resume() // need to manually start it since we have no on('data')
;

@@ -79,4 +84,5 @@ });

.on('data', function (result) {
result.test.should.be.true;
result.should.eql({ test: true });
})
.on('error', shouldNotError)
.on('end', done)

@@ -89,4 +95,6 @@ ;

.on('data', function (result) {
result.nodes[0].test.should.be.true;
// 10x { test: true }
result.should.eql({ nodes: [{ test: true }, { test: true }, { test: true }, { test: true }, { test: true }, { test: true }, { test: true }, { test: true }, { test: true }, { test: true } ] });
})
.on('error', shouldNotError)
.on('end', done)

@@ -99,4 +107,5 @@ ;

.on('data', function (result) {
result.labels[0].should.equal('Test');
result.should.eql({ labels: ['Test']});
})
.on('error', shouldNotError)
.on('end', done)

@@ -111,2 +120,3 @@ ;

})
.on('error', shouldNotError)
.on('end', done)

@@ -116,2 +126,12 @@ ;

it('handles null', function (done) {
cypher('return null')
.on('data', function (result) {
result.should.eql({ "null": null });
})
.on('error', shouldNotError)
.on('end', done)
;
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc