From e3690f808602b8257ddd8f9a5fc71a170f2eafce Mon Sep 17 00:00:00 2001 From: Andrew Curtis Date: Mon, 11 Sep 2023 11:17:50 -0400 Subject: [PATCH] chore(package): bump holocron to 1.8.1 --- __tests__/server/middleware/pwa/offline.spec.jsx | 16 ++++++++++++---- package-lock.json | 9 +++++---- package.json | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/__tests__/server/middleware/pwa/offline.spec.jsx b/__tests__/server/middleware/pwa/offline.spec.jsx index 71df81649..c1780190a 100644 --- a/__tests__/server/middleware/pwa/offline.spec.jsx +++ b/__tests__/server/middleware/pwa/offline.spec.jsx @@ -20,7 +20,7 @@ import React from 'react'; import { Helmet } from 'react-helmet'; -import { registerModule } from 'holocron'; +import { RenderModule, registerModule } from 'holocron'; import { createRequest, createResponse } from 'node-mocks-http'; import oneApp from '../../../../src/universal'; @@ -36,6 +36,10 @@ jest.mock('fs', () => ({ existsSync: () => false, readFileSync: (filePath) => Buffer.from(filePath.endsWith('noop.js') ? '[service-worker-noop-script]' : '[service-worker-script]'), })); +jest.mock('holocron', () => ({ + ...jest.requireActual('holocron'), + RenderModule: jest.fn(), +})); describe('offline middleware', () => { beforeAll(() => { @@ -48,7 +52,9 @@ describe('offline middleware', () => { global.fetch = jest.fn(() => Promise.resolve({})); const rootModuleName = 'root-module'; - registerModule(rootModuleName, () => React.createElement('p', null, 'Hi there')); + const RootModule = () => React.createElement('p', null, 'Hi there'); + registerModule(rootModuleName, RootModule); + RenderModule.mockImplementation(() => ); setStateConfig({ rootModuleName: { server: rootModuleName, @@ -100,7 +106,7 @@ describe('offline middleware', () => { const middleware = createOfflineMiddleware(oneApp); const req = createRequest(); const res = createResponse(); - registerModule('root-module', () => ( + const RootModule = () => ( @@ -109,7 +115,9 @@ describe('offline middleware', () => { hello

- )); + ); + registerModule('root-module', RootModule); + RenderModule.mockImplementation(() => ); await expect(middleware(req, res)).resolves.toBeUndefined(); expect(req.appHtml).toEqual('

hello

'); diff --git a/package-lock.json b/package-lock.json index 4abac89fc..11612d3ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "express-prom-bundle": "^6.6.0", "flat": "^5.0.2", "helmet": "^3.22.0", - "holocron": "^1.7.0", + "holocron": "^1.8.1", "holocron-module-route": "^1.2.1", "immutable": "^4.0.0", "ip": "^1.1.5", @@ -13594,9 +13594,9 @@ } }, "node_modules/holocron": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/holocron/-/holocron-1.7.0.tgz", - "integrity": "sha512-gz88zT+JuIWC19o+7tgFl9whUqrCS5TGFga2QSJU3CLLYzlYMf1UsW13lGE1QjBIQDDwYlwPY2+FSUeejeg9mg==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/holocron/-/holocron-1.8.1.tgz", + "integrity": "sha512-jIR6tYjyZyODpc7D8TGddyoTFy3bTJ/5aClHHp9PR5R5QfmmHra+wpN6mkKi7R5+w3LPrbE1bK5NLZ4hdAZ5IA==", "dependencies": { "@americanexpress/vitruvius": "^2.0.0", "hoist-non-react-statics": "^3.3.0", @@ -13608,6 +13608,7 @@ "redux-thunk": "^2.1.0", "require-from-string": "^1.2.1", "reselect": "^4.0.0", + "semver": "^7.3.8", "shallowequal": "^1.1.0", "ssri": "^7.0.1" }, diff --git a/package.json b/package.json index cea83121e..40e3b4a71 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "express-prom-bundle": "^6.6.0", "flat": "^5.0.2", "helmet": "^3.22.0", - "holocron": "^1.7.0", + "holocron": "^1.8.1", "holocron-module-route": "^1.2.1", "immutable": "^4.0.0", "ip": "^1.1.5",