hmpo-cached-model
Advanced tools
Comparing version 3.0.3 to 4.0.0
@@ -48,2 +48,3 @@ 'use strict'; | ||
this.lastModified = Date.now(); | ||
this.reset(); | ||
this.set(data); | ||
@@ -83,2 +84,3 @@ | ||
this.lastModified = Date.now(); | ||
this.reset(); | ||
this.set(data); | ||
@@ -85,0 +87,0 @@ cb(); |
{ | ||
"name": "hmpo-cached-model", | ||
"version": "3.0.3", | ||
"version": "4.0.0", | ||
"description": "Cached polling model", | ||
@@ -19,3 +19,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -29,11 +29,11 @@ "bugs": { | ||
"debug": "^4.3.1", | ||
"hmpo-model": "^3.2.2" | ||
"hmpo-model": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"eslint": "^7.26.0", | ||
"eslint": "^8.3.0", | ||
"hmpo-logger": "^4.1.3", | ||
"mocha": "^8.4.0", | ||
"mocha": "^9.1.3", | ||
"nyc": "^15.1.0", | ||
"sinon": "^10.0.0", | ||
"sinon": "^12.0.1", | ||
"sinon-chai": "^3.6.0" | ||
@@ -40,0 +40,0 @@ }, |
@@ -46,1 +46,7 @@ # hmpo-cached-model | ||
## Upgrading | ||
The deprecated `request` library has been replaced with `got` in `hmpo-model`. | ||
The new `got` library doesn't automativally use the proxy environment variables so you would need to use something like `global-agent` in your | ||
app if you need to specify proxies by environment arguments. |
@@ -12,2 +12,5 @@ 'use strict'; | ||
const hmpoLogger = require('hmpo-logger'); | ||
hmpoLogger.config({ app: false, error: false, console: false }); | ||
describe('HmpoCachedModel', () => { | ||
@@ -19,2 +22,3 @@ let clock, instance, storeFactory, storeStub, options, cb; | ||
sinon.stub(HmpoModel.prototype, 'fetch').yields(null, { a: 1, b: 2 }); | ||
sinon.stub(HmpoModel.prototype, 'reset'); | ||
sinon.stub(HmpoModel.prototype, 'set'); | ||
@@ -46,2 +50,3 @@ sinon.stub(HmpoModel.prototype, 'get'); | ||
HmpoModel.prototype.fetch.restore(); | ||
HmpoModel.prototype.reset.restore(); | ||
HmpoModel.prototype.set.restore(); | ||
@@ -161,2 +166,3 @@ HmpoModel.prototype.get.restore(); | ||
instance.getStoreData(cb); | ||
HmpoModel.prototype.reset.should.have.been.calledWithExactly(); | ||
HmpoModel.prototype.set.should.have.been.calledWithExactly({ | ||
@@ -250,2 +256,3 @@ a: 1, b: 2 | ||
instance.getDataFromAPI(cb); | ||
HmpoModel.prototype.reset.should.have.been.calledWithExactly(); | ||
HmpoModel.prototype.set.should.have.been.calledWithExactly({ | ||
@@ -459,4 +466,4 @@ a: 1, b: 2 | ||
it('should clear the two interval timers', () => { | ||
instance.storeTimer = 123; | ||
instance.apiTimer = 456; | ||
instance.storeTimer = setInterval(()=>{}, 10000); | ||
instance.apiTimer = setInterval(()=>{}, 10000); | ||
instance.stop(); | ||
@@ -463,0 +470,0 @@ expect(instance.storeTimer).to.not.be.ok; |
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
25800
526
52
+ Added@sindresorhus/is@4.6.0(transitive)
+ Added@szmarczak/http-timer@4.0.6(transitive)
+ Added@tootallnate/once@2.0.0(transitive)
+ Added@types/cacheable-request@6.0.3(transitive)
+ Added@types/http-cache-semantics@4.0.4(transitive)
+ Added@types/keyv@3.1.4(transitive)
+ Added@types/node@22.10.1(transitive)
+ Added@types/responselike@1.0.3(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedcacheable-lookup@5.0.4(transitive)
+ Addedcacheable-request@7.0.4(transitive)
+ Addedclone-response@1.0.3(transitive)
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddefer-to-connect@2.0.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedgot@11.8.6(transitive)
+ Addedhmpo-model@4.3.0(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedhttp-proxy-agent@5.0.0(transitive)
+ Addedhttp2-wrapper@1.0.3(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedlowercase-keys@2.0.0(transitive)
+ Addedmimic-response@1.0.13.1.0(transitive)
+ Addednormalize-url@6.1.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-cancelable@2.1.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquick-lru@5.1.1(transitive)
+ Addedresolve-alpn@1.2.1(transitive)
+ Addedresponselike@2.0.1(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhmpo-model@3.2.2(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.14.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removedunderscore@1.13.7(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)
Updatedhmpo-model@^4.0.0