From 1c45062d3a0002a3b2a83e22c82cf49db253fe64 Mon Sep 17 00:00:00 2001 From: Vishvamsinh Vaghela <90895835+vishvamsinh28@users.noreply.github.com> Date: Fri, 22 Nov 2024 23:46:40 +0530 Subject: [PATCH] fix: file not found issue fixed for build tools and newsroom video script (#3422) Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- tests/build-newsroom-videos.test.js | 3 ++- tests/build-tools.test.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/build-newsroom-videos.test.js b/tests/build-newsroom-videos.test.js index 494f91f27341..188bc2dffc70 100644 --- a/tests/build-newsroom-videos.test.js +++ b/tests/build-newsroom-videos.test.js @@ -1,4 +1,4 @@ -const { readFileSync, removeSync, mkdirpSync } = require('fs-extra'); +const { readFileSync, removeSync, mkdirpSync, outputFileSync } = require('fs-extra'); const { resolve, join } = require('path'); const { buildNewsroomVideos } = require('../scripts/build-newsroom-videos'); const { mockApiResponse, expectedResult } = require('./fixtures/newsroomData'); @@ -13,6 +13,7 @@ describe('buildNewsroomVideos', () => { beforeAll(() => { mkdirpSync(testDir); + outputFileSync(testFilePath, JSON.stringify({})); process.env.YOUTUBE_TOKEN = 'testkey'; }); diff --git a/tests/build-tools.test.js b/tests/build-tools.test.js index 74524ddb9775..6cb391d93deb 100644 --- a/tests/build-tools.test.js +++ b/tests/build-tools.test.js @@ -37,6 +37,9 @@ describe('buildTools', () => { consoleErrorMock = jest.spyOn(console, 'error').mockImplementation(() => {}); fs.ensureDirSync(testDir); fs.outputFileSync(manualToolsPath, JSON.stringify(manualTools)); + fs.outputFileSync(automatedToolsPath, JSON.stringify({})); + fs.outputFileSync(toolsPath, JSON.stringify({})); + fs.outputFileSync(tagsPath, JSON.stringify({})); }); afterAll(() => {