diff --git a/tests/data.test.js b/tests/data.test.js index 62ae215..a076e7c 100644 --- a/tests/data.test.js +++ b/tests/data.test.js @@ -34,6 +34,19 @@ describe('#src/data', () => { ) }) }) + + it('returns an empty object if the data file does not exist', async () => { + await withTempDir(async (prefixWithTempDir) => { + const dirPath = prefixWithTempDir('src') + + await mkdir(dirPath) + + assert.deepStrictEqual( + await parseDataFromJsonFile(withDir(dirPath), ifPathExists, readFile, parseJson), + {} + ) + }) + }) }) describe('parseDataFromEnv()', () => {