mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
Added basic unit test for cache adapter module
- this helps improve our testing capabilities of the new cache adapters
This commit is contained in:
parent
247d0f1f92
commit
4bca725215
17
ghost/core/test/unit/server/adapters/cache/Cache.test.js
vendored
Normal file
17
ghost/core/test/unit/server/adapters/cache/Cache.test.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
const assert = require('assert');
|
||||
|
||||
const {getCache} = require('../../../../../core/server/adapters/cache');
|
||||
const MemoryCache = require('../../../../../core/server/adapters/cache/Memory');
|
||||
|
||||
describe('Cache Adapter', function () {
|
||||
it('defaults to in-memory cache', function () {
|
||||
const cacheAdapter = getCache('foo');
|
||||
assert.equal(cacheAdapter instanceof MemoryCache, true);
|
||||
});
|
||||
|
||||
it('returns the same instance for the same name', function () {
|
||||
const cacheAdapter1 = getCache('foo');
|
||||
const cacheAdapter2 = getCache('foo');
|
||||
assert.equal(cacheAdapter1, cacheAdapter2);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user