From 8497886b2300243bf0a2d27e54c22d182c044a8f Mon Sep 17 00:00:00 2001 From: Dmitry9 Date: Tue, 7 May 2019 14:32:57 +0300 Subject: [PATCH] added test for caching --- test/datasource/cargo/index.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/datasource/cargo/index.spec.js diff --git a/test/datasource/cargo/index.spec.js b/test/datasource/cargo/index.spec.js new file mode 100644 index 0000000000..48c97b893f --- /dev/null +++ b/test/datasource/cargo/index.spec.js @@ -0,0 +1,15 @@ +const cargo = require('../../../lib/datasource/cargo'); + +describe('cargo datasource', () => { + beforeEach(() => { + return global.renovateCache.rmAll(); + }); + it('should use global cache', async () => { + const dep = { + name: 'abc123', + }; + await global.renovateCache.set('datasource-cargo', 'foobar', dep, 10); + const res = await cargo.getPkgReleases({ lookupName: 'foobar' }); + expect(res).toEqual(dep); + }); +});