neo-forgery
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -6,3 +6,3 @@ "use strict"; | ||
async function testQuerySet(querySet, databaseInfo) { | ||
const session = getSession(databaseInfo); | ||
const session = getSession.getSession(databaseInfo); | ||
for (let i = 0; i < querySet.length; i++) { | ||
@@ -9,0 +9,0 @@ const querySpec = querySet[i]; |
@@ -7,2 +7,4 @@ export * from './custom/types/DatabaseInfo'; | ||
export declare const mockSessionFromFunction: any; | ||
export declare const mockResultsFromCapturedOutput: any; | ||
export declare const mockResultsFromData: any; | ||
export declare const testQuerySet: any; |
@@ -5,3 +5,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.testQuerySet = exports.mockSessionFromFunction = exports.mockSessionFromQuerySet = void 0; | ||
exports.testQuerySet = exports.mockResultsFromData = exports.mockResultsFromCapturedOutput = exports.mockSessionFromFunction = exports.mockSessionFromQuerySet = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -17,3 +17,5 @@ /* ns__custom_end beginning */ | ||
exports.mockSessionFromFunction = require('./custom/session/mockSessionFromFunction'); | ||
exports.mockResultsFromCapturedOutput = require('./custom/results/mockResultsFromCapturedOutput'); | ||
exports.mockResultsFromData = require('./custom/results/mockResultsFromData'); | ||
exports.testQuerySet = require('./custom/session/testQuerySet').testQuerySet; | ||
/* ns__custom_end export */ |
@@ -5,3 +5,3 @@ { | ||
"author": "YizYah", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"bugs": "https://github.com/YizYah/neo-forgery/issues", | ||
@@ -56,2 +56,3 @@ "engines": { | ||
"prettier": "^2.2.1", | ||
"proxyquire": "^2.1.3", | ||
"semantic-release": "^17.4.2", | ||
@@ -58,0 +59,0 @@ "ts-node": "^9.1.1", |
@@ -44,6 +44,16 @@ | ||
# Why | ||
[//]: # ( ns__custom_start toc ) | ||
<!-- toc --> | ||
* [:clipboard: Why](#clipboard-why) | ||
* [:white_check_mark: What](#white_check_mark-what) | ||
* [:wrench: Usage](#wrench-usage) | ||
* [:heavy_exclamation_mark: Limits](#heavy_exclamation_mark-limits) | ||
<!-- tocstop --> | ||
[//]: # ( ns__custom_end toc ) | ||
# <a name="clipboard-why"></a>:clipboard: Why | ||
I couldn't find any other straightforward way to mock the neo4j driver during unit tests. It needs to be super fast and simple to work with CI and TDD. | ||
# What | ||
# <a name="white_check_mark-what"></a>:white_check_mark: What | ||
A mock session generator for neo4j. You set up a mock neo4j session by specifying an array of query spec objects. Each query spec object contains a query string, param set, and expected response. | ||
@@ -55,3 +65,3 @@ | ||
# Usage | ||
# <a name="wrench-usage"></a>:wrench: Usage | ||
@@ -74,3 +84,3 @@ Include the package in dev: | ||
![](images/gettingResponse.png) | ||
![response](images/gettingResponse.jpg) | ||
@@ -187,3 +197,3 @@ __*NOTE*__ If you copy from the data browser, you'll only get the `records` portion of the output. You'll have to paste it in as a value for `records` in an object: | ||
# Limits | ||
# <a name="heavy_exclamation_mark-limits"></a>:heavy_exclamation_mark: Limits | ||
1. This package will not help you to test a section of code where you explicitly declare a session using neo4j-driver. Rather, it helps when you can pass in a session as a parameter. | ||
@@ -190,0 +200,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21481
248
216
13