@pbvision/fastify-firestore-service 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pbvision/fastify-firestore-service",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Web Framework using Fastify and Firestore ORM",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -3,7 +3,7 @@ import fp from 'fastify-plugin'
3
3
 
4
4
  function addCookiePlugin (fastify, options, next) {
5
5
  // istanbul ignore if
6
- if (options.cookie.disabled) {
6
+ if (options.cookie.disabled || !options.cookie.secret) {
7
7
  next()
8
8
  return
9
9
  }
package/test/base-test.js CHANGED
@@ -5,8 +5,6 @@ import { BaseTest, runTests } from '@pbvision/jest-unit-test'
5
5
  import superagentDefaults from 'superagent-defaults'
6
6
  import supertest from 'supertest'
7
7
 
8
- import makeService from '../src/app.js'
9
-
10
8
  let FASTIFY_CACHE
11
9
 
12
10
  afterAll(async () => {
@@ -15,7 +13,13 @@ afterAll(async () => {
15
13
  })
16
14
 
17
15
  class BaseAppTest extends BaseTest {
16
+ async getMakeServiceFunc () {
17
+ const { default: func } = await import('../src/app.js')
18
+ return func
19
+ }
20
+
18
21
  async beforeAll () {
22
+ const makeService = await this.getMakeServiceFunc()
19
23
  this.fastify = FASTIFY_CACHE ?? await makeService()
20
24
  FASTIFY_CACHE = this.fastify
21
25