Skip to content

Commit 89a8997

Browse files
committed
Move tests into
1 parent a10898a commit 89a8997

File tree

7 files changed

+62
-12
lines changed

7 files changed

+62
-12
lines changed

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
import {int, isInt} from './v1/integer';
2121
import Driver from './v1/driver';
22+
import VERSION from './version';
23+
import * as v1 from './v1/index.js';
2224

23-
let USER_AGENT = "neo4j-javascript/0.0";
25+
let USER_AGENT = "neo4j-javascript/" + VERSION;
26+
27+
console.log(v1);
2428

2529
export default {
26-
v1: {
27-
driver: (url) => new Driver(url, USER_AGENT),
28-
int: int,
29-
isInt: isInt
30-
}
30+
v1: v1
3131
}

src/v1/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright (c) 2002-2015 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
import {int, isInt} from './integer';
21+
import Driver from './driver';
22+
import {VERSION} from '../version';
23+
24+
let USER_AGENT = "neo4j-javascript/" + VERSION;
25+
26+
export default {
27+
driver: (url) => new Driver(url, USER_AGENT),
28+
int: int,
29+
isInt: isInt
30+
}

src/v1/result-summary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20-
import neo4j from '../index';
20+
import {int, isInt} from './integer';
2121

2222
/**
2323
* A ResultSummary instance contains structured metadata for a {Result}.
@@ -126,7 +126,7 @@ class StatementStatistics {
126126
constraintsRemoved: 0
127127
}
128128
Object.keys(statistics).forEach((index) => {
129-
let val = neo4j.v1.isInt(statistics[index]) ? statistics[index].toInt() : statistics[index];
129+
let val = isInt(statistics[index]) ? statistics[index].toInt() : statistics[index];
130130
//To camelCase
131131
this._stats[index.replace(/(\-\w)/g, (m) => m[1].toUpperCase())] = val;
132132
});

src/version.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) 2002-2015 "Neo Technology,"
3+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
export default { VERSION : "0.0.0-dev" };

test/driver.test.js renamed to test/v1/driver.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20-
var neo4j = require("../lib/index").v1;
20+
var neo4j = require("../../lib/v1");
2121

2222
describe('driver', function() {
2323
it('should expose sessions', function() {

test/session.test.js renamed to test/v1/session.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* limitations under the License.
1818
*/
1919

20-
var neo4j = require("../lib/index").v1;
21-
var StatementType = require("../lib/v1/result-summary").statementType;
20+
var neo4j = require("../../lib/v1");
21+
var StatementType = require("../../lib/v1/result-summary").statementType;
2222

2323
describe('session', function() {
2424
it('should expose basic run/subscribe ', function(done) {

test/types.test.js renamed to test/v1/types.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20-
var neo4j = require("../lib/index").v1;
20+
var neo4j = require("../../lib/v1");
2121

2222
describe('floating point values', function() {
2323
it('should support float 1.0 ', testVal( 1 ) );

0 commit comments

Comments
 (0)