added test for caching

This commit is contained in:
Dmitry9 2019-05-07 14:32:57 +03:00 committed by Rhys Arkins
parent 3dead5861b
commit 8497886b23

View file

@ -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);
});
});