Skip to content

Commit 4ae66ab

Browse files
committed
moved before to enivronment file
1 parent 4044b08 commit 4ae66ab

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/v1/tck/steps/environment.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var neo4j = require("../../../../lib/v1");
2+
3+
module.exports = function () {
4+
5+
this.Before(function( scenario, callback ) {
6+
this.driver = neo4j.driver("bolt://localhost");
7+
this.session = this.driver.session();
8+
if (findTag(scenario, '@reset_database')) {
9+
this.session.run("MATCH (n) DETACH DELETE n").then( function( ) {
10+
callback();
11+
});
12+
}
13+
callback();
14+
});
15+
16+
function findTag(scenario, tag) {
17+
for (var i in scenario.getTags()) {
18+
if (scenario.getTags()[i].getName() == tag) {
19+
return true
20+
}
21+
}
22+
return false;
23+
}
24+
}

0 commit comments

Comments
 (0)