cache-manager 3.3.0 → 3.4.0
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/History.md +3 -0
- package/package.json +11 -11
- package/test/caching.unit.js +11 -11
package/History.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cache-manager",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Cache module for Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"author": "Bryan Donovan",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"async": "
|
|
24
|
-
"lodash": "^4.17.
|
|
25
|
-
"lru-cache": "
|
|
23
|
+
"async": "^3.2.0",
|
|
24
|
+
"lodash": "^4.17.20",
|
|
25
|
+
"lru-cache": "6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"coveralls": "3.0
|
|
29
|
-
"es6-promise": "^
|
|
30
|
-
"eslint": "
|
|
31
|
-
"jsdoc": "3.
|
|
32
|
-
"mocha": "
|
|
33
|
-
"nyc": "
|
|
28
|
+
"coveralls": "3.1.0",
|
|
29
|
+
"es6-promise": "^4.2.8",
|
|
30
|
+
"eslint": "7.7.0",
|
|
31
|
+
"jsdoc": "3.6.5",
|
|
32
|
+
"mocha": "8.1.1",
|
|
33
|
+
"nyc": "15.1.0",
|
|
34
34
|
"optimist": "0.6.1",
|
|
35
|
-
"sinon": "
|
|
35
|
+
"sinon": "9.0.3"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/test/caching.unit.js
CHANGED
|
@@ -397,8 +397,8 @@ describe("caching", function() {
|
|
|
397
397
|
|
|
398
398
|
cache = caching({store: 'memory'});
|
|
399
399
|
|
|
400
|
-
function isDone() {
|
|
401
|
-
|
|
400
|
+
function isDone(cb) {
|
|
401
|
+
cb(null, processed === keyCount);
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
async.until(isDone, function(cb) {
|
|
@@ -437,8 +437,8 @@ describe("caching", function() {
|
|
|
437
437
|
|
|
438
438
|
cache = caching({store: memoryStore.create({noPromises: true})});
|
|
439
439
|
|
|
440
|
-
function isDone() {
|
|
441
|
-
|
|
440
|
+
function isDone(cb) {
|
|
441
|
+
cb(null, processed === keyCount);
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
async.until(isDone, function(cb) {
|
|
@@ -790,7 +790,7 @@ describe("caching", function() {
|
|
|
790
790
|
it("bubbles up that error", function(done) {
|
|
791
791
|
var fakeError = new Error(support.random.string());
|
|
792
792
|
|
|
793
|
-
sinon.stub(memoryStoreStub, 'get'
|
|
793
|
+
sinon.stub(memoryStoreStub, 'get').callsFake(function(key, options, cb) {
|
|
794
794
|
cb(fakeError);
|
|
795
795
|
});
|
|
796
796
|
|
|
@@ -810,7 +810,7 @@ describe("caching", function() {
|
|
|
810
810
|
|
|
811
811
|
var fakeError = new Error(support.random.string());
|
|
812
812
|
|
|
813
|
-
sinon.stub(memoryStoreStub, 'get'
|
|
813
|
+
sinon.stub(memoryStoreStub, 'get').callsFake(function(key, options, cb) {
|
|
814
814
|
cb(fakeError);
|
|
815
815
|
});
|
|
816
816
|
|
|
@@ -830,7 +830,7 @@ describe("caching", function() {
|
|
|
830
830
|
it("bubbles up that error", function(done) {
|
|
831
831
|
var fakeError = new Error(support.random.string());
|
|
832
832
|
|
|
833
|
-
sinon.stub(memoryStoreStub, 'set'
|
|
833
|
+
sinon.stub(memoryStoreStub, 'set').callsFake(function(key, val, ttl, cb) {
|
|
834
834
|
cb(fakeError);
|
|
835
835
|
});
|
|
836
836
|
|
|
@@ -865,7 +865,7 @@ describe("caching", function() {
|
|
|
865
865
|
context("when wrapped function calls back with an error", function() {
|
|
866
866
|
it("calls back with that error", function(done) {
|
|
867
867
|
var fakeError = new Error(support.random.string());
|
|
868
|
-
sinon.stub(methods, 'getWidget'
|
|
868
|
+
sinon.stub(methods, 'getWidget').callsFake(function(name, cb) {
|
|
869
869
|
cb(fakeError, {name: name});
|
|
870
870
|
});
|
|
871
871
|
|
|
@@ -942,7 +942,7 @@ describe("caching", function() {
|
|
|
942
942
|
context("when result is already cached", function() {
|
|
943
943
|
it("retrieves data from cache", function(done) {
|
|
944
944
|
var funcCalled = false;
|
|
945
|
-
sinon.stub(memoryStoreStub, 'mget'
|
|
945
|
+
sinon.stub(memoryStoreStub, 'mget').callsFake(function() {
|
|
946
946
|
var args = Array.prototype.slice.apply(arguments);
|
|
947
947
|
var cb = args.pop();
|
|
948
948
|
cb(null, [{name: name}, {name: name2}]);
|
|
@@ -1045,7 +1045,7 @@ describe("caching", function() {
|
|
|
1045
1045
|
it("bubbles up that error", function(done) {
|
|
1046
1046
|
var fakeError = new Error(support.random.string());
|
|
1047
1047
|
|
|
1048
|
-
sinon.stub(memoryStoreStub, 'mget'
|
|
1048
|
+
sinon.stub(memoryStoreStub, 'mget').callsFake(function() {
|
|
1049
1049
|
var args = Array.prototype.slice.apply(arguments);
|
|
1050
1050
|
var cb = args.pop();
|
|
1051
1051
|
cb(fakeError);
|
|
@@ -1067,7 +1067,7 @@ describe("caching", function() {
|
|
|
1067
1067
|
|
|
1068
1068
|
var fakeError = new Error(support.random.string());
|
|
1069
1069
|
|
|
1070
|
-
sinon.stub(memoryStoreStub, 'mget'
|
|
1070
|
+
sinon.stub(memoryStoreStub, 'mget').callsFake(function() {
|
|
1071
1071
|
var args = Array.prototype.slice.apply(arguments);
|
|
1072
1072
|
var cb = args.pop();
|
|
1073
1073
|
cb(fakeError);
|