session
session copied to clipboard
file-store throws error and not null if session not found
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the issue has not already been raised
Issue
it seems that there are some issues. This test script will not work on master, yet.
'use strict'
const { mock, before, afterEach } = require('tap')
const fileStoreFactory = require('session-file-store')
const fastifySession = require('../lib/fastifySession')
const FileStoreFactory = fileStoreFactory(fastifySession)
const client = new FileStoreFactory({})
function FileStore() {
return client
}
before(async () => {
await new Promise(resolve => {
client.clear(resolve)
})
})
afterEach(async () => {
await new Promise(resolve => {
client.clear(resolve)
})
})
mock('./base.test', { '../lib/store': FileStore })
mock('./cookie.test', { '../lib/store': FileStore })
mock('./session.test', { '../lib/store': FileStore })
mock('./store.test', { '../lib/store': FileStore })