Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix(cache-cdn): stringify object (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishnubista committed Sep 28, 2023
1 parent 9f7c64d commit 8715017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/server/utils/cdnCache.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('cacheUtils', () => {
expect(logSpy).toHaveBeenCalledWith(`Creating ${cacheFileName}`);
expect(fsPromises.writeFile).toHaveBeenCalledWith(
oneAppModuleCachePath,
JSON.stringify('{}')
JSON.stringify({})
);
expect(logSpy).toHaveBeenCalledWith(`${cacheFileName} created successfully on ${oneAppModuleCachePath}`);
expect(errorSpy).not.toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion src/server/utils/cdnCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const setupCacheFile = async () => {
console.log(`Successfully created ${oneAppDirectoryPath}`);
console.log(`Creating ${cacheFileName}`);
try {
await fsPromises.writeFile(oneAppModuleCachePath, JSON.stringify('{}'));
await fsPromises.writeFile(oneAppModuleCachePath, JSON.stringify({}));
console.log(`${cacheFileName} created successfully on ${oneAppModuleCachePath}`);
} catch (error) {
console.error(`Error creating ${cacheFileName} on ${oneAppModuleCachePath}, \n${error}`);
Expand Down

0 comments on commit 8715017

Please sign in to comment.