Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs')
const path = require('path')
const sinon = require('sinon')
const should = require('should')
const noderedis = require('redis')
const Stream = require('stream')
const toString = require('stream-to-string')
const RedisMock = require('ioredis-mock').default
const exec = require('child_process').exec
const EventEmitter = require('events').EventEmitter
const Cache = require('./../../lib/index')
/* RedisMock is not complete, so must create some stubs */
RedisMock.prototype.on = () => {}
RedisMock.prototype.status = 'ready'
var cache
describe('RedisCache', () => {
describe('set', () => {
after(done => {
// remove cache folder contents completely, and recreate
const cleanup = dir => {
exec('rm -r ' + dir, (_, stdout, stderr) => {
exec('mkdir ' + dir)
done()
})
}
if (cache.cacheHandler.directory) {
cleanup(path.resolve(cache.cacheHandler.directory))
const fs = require('fs')
const path = require('path')
const sinon = require('sinon')
const should = require('should')
const noderedis = require('redis')
const Stream = require('stream')
const toString = require('stream-to-string')
const RedisMock = require('ioredis-mock').default
const exec = require('child_process').exec
const EventEmitter = require('events').EventEmitter
const Cache = require('./../../lib/index')
/* RedisMock is not complete, so must create some stubs */
RedisMock.prototype.on = () => {}
RedisMock.prototype.status = 'ready'
var cache
describe('RedisCache', () => {
describe('set', () => {
after(done => {
// remove cache folder contents completely, and recreate
const cleanup = dir => {
exec('rm -r ' + dir, (_, stdout, stderr) => {
exec('mkdir ' + dir)
done()
})
}
if (cache.cacheHandler.directory) {