session icon indicating copy to clipboard operation
session copied to clipboard

file-store throws error and not null if session not found

Open Uzlopak opened this issue 3 years ago • 0 comments

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

Uzlopak avatar Aug 24 '22 09:08 Uzlopak