Skip to content

Commit

Permalink
fix compression tests for case when there is no file
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Jamrozik committed Jul 6, 2024
1 parent 9feeb75 commit 85b989a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/test/lib_tests/compression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('compression tests', () => {
try {
const strFromFile = await getStrFromInputFile(repoDir)

const inputData = strFromFile.length > 0 ? strFromFile : inputDataStr
const inputData = strFromFile.length > 2 ? strFromFile : inputDataStr
console.log(
`strFromFile.length: ${strFromFile.length}, inputData.length: ${inputData.length}`,
)
Expand Down Expand Up @@ -115,7 +115,7 @@ async function getStrFromInputFile(repoDir: string): Promise<string> {

const rawStrFromFile = inputFileExists
? await readFile(inputFilePath, 'utf8')
: ''
: '{}'

const strFromFile = JSON.stringify(JSON.parse(rawStrFromFile))

Expand Down

0 comments on commit 85b989a

Please sign in to comment.