neo4j-driver 1.5.0-beta01 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ We build a special browser version of the driver, which supports connecting to N
48
48
  This will make a global `neo4j` object available, where you can access the `v1` API at `neo4j.v1`:
49
49
 
50
50
  ```javascript
51
- var driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j"));
51
+ var driver = neo4j.v1.driver("bolt://localhost", neo4j.v1.auth.basic("neo4j", "neo4j"));
52
52
  ```
53
53
 
54
54
  It is not required to explicitly close the driver on a web page. Web browser should gracefully close all open
@@ -61,23 +61,12 @@ driver.close();
61
61
 
62
62
  ## Usage examples
63
63
 
64
- Driver creation:
64
+ Driver lifecycle:
65
65
  ```javascript
66
66
  // Create a driver instance, for the user neo4j with password neo4j.
67
67
  // It should be enough to have a single driver per database per application.
68
68
  var driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j"));
69
69
 
70
- // Register a callback to know if driver creation was successful:
71
- driver.onCompleted = function () {
72
- // proceed with using the driver, it was successfully instantiated
73
- };
74
-
75
- // Register a callback to know if driver creation failed.
76
- // This could happen due to wrong credentials or database unavailability:
77
- driver.onError = function (error) {
78
- console.log('Driver instantiation failed', error);
79
- };
80
-
81
70
  // Close the driver when application exits.
82
71
  // This closes all used network connections.
83
72
  driver.close();
package/gulpfile.babel.js CHANGED
@@ -26,7 +26,6 @@ var uglify = require('gulp-uglify');
26
26
  var gutil = require('gulp-util');
27
27
  var download = require("gulp-download");
28
28
  var jasmine = require('gulp-jasmine');
29
- var jasmineBrowser = require('gulp-jasmine-browser');
30
29
  var babelify = require('babelify');
31
30
  var babel = require('gulp-babel');
32
31
  var watch = require('gulp-watch');
@@ -44,6 +43,8 @@ var file = require('gulp-file');
44
43
  var semver = require('semver');
45
44
  var sharedNeo4j = require('./test/internal/shared-neo4j').default;
46
45
  var ts = require('gulp-typescript');
46
+ var JasmineConsoleReporter = require('jasmine-console-reporter');
47
+ var karmaServer = require('karma').Server;
47
48
 
48
49
  /**
49
50
  * Useful to investigate resource leaks in tests. Enable to see active sockets and file handles after the 'test' task.
@@ -166,15 +167,7 @@ gulp.task('test-nodejs', ['install-driver-into-sandbox'], function () {
166
167
  return gulp.src('test/**/*.test.js')
167
168
  .pipe(jasmine({
168
169
  includeStackTrace: true,
169
- verbose: true
170
- })).on('end', logActiveNodeHandles);
171
- });
172
-
173
- gulp.task('test-boltkit', ['nodejs'], function () {
174
- return gulp.src('test/**/*.boltkit.it.js')
175
- .pipe(jasmine({
176
- includeStackTrace: true,
177
- verbose: true
170
+ reporter: newJasmineConsoleReporter()
178
171
  })).on('end', logActiveNodeHandles);
179
172
  });
180
173
 
@@ -182,10 +175,26 @@ gulp.task('test-browser', function (cb) {
182
175
  runSequence('all', 'run-browser-test', cb)
183
176
  });
184
177
 
185
- gulp.task('run-browser-test', function(){
186
- return gulp.src('lib/browser/neo4j-web.test.js')
187
- .pipe(jasmineBrowser.specRunner({console: true}))
188
- .pipe(jasmineBrowser.headless())
178
+ gulp.task('run-browser-test', function(cb){
179
+ runSequence('run-browser-test-firefox', cb);
180
+ });
181
+
182
+ gulp.task('run-browser-test-chrome', function(cb){
183
+ new karmaServer({
184
+ configFile: __dirname + '/test/browser/karma-chrome.conf.js',
185
+ }, cb).start();
186
+ });
187
+
188
+ gulp.task('run-browser-test-firefox', function(cb){
189
+ new karmaServer({
190
+ configFile: __dirname + '/test/browser/karma-firefox.conf.js',
191
+ }, cb).start();
192
+ });
193
+
194
+ gulp.task('run-browser-test-edge', function(cb){
195
+ new karmaServer({
196
+ configFile: __dirname + '/test/browser/karma-edge.conf.js',
197
+ }, cb).start();
189
198
  });
190
199
 
191
200
  gulp.task('watch', function () {
@@ -249,7 +258,7 @@ gulp.task('run-stress-tests', function () {
249
258
  return gulp.src('test/**/stress.test.js')
250
259
  .pipe(jasmine({
251
260
  includeStackTrace: true,
252
- verbose: true
261
+ reporter: newJasmineConsoleReporter()
253
262
  })).on('end', logActiveNodeHandles);
254
263
  });
255
264
 
@@ -281,3 +290,13 @@ function logActiveNodeHandles() {
281
290
  console.log('-- Active NodeJS handles START\n', process._getActiveHandles(), '\n-- Active NodeJS handles END');
282
291
  }
283
292
  }
293
+
294
+ function newJasmineConsoleReporter() {
295
+ return new JasmineConsoleReporter({
296
+ colors: 1,
297
+ cleanStack: 1,
298
+ verbosity: 4,
299
+ listStyle: 'indent',
300
+ activity: false
301
+ });
302
+ }