diff --git a/test/lib/index.test.js b/test/lib/index.test.js index edf1b0e..ea1d140 100644 --- a/test/lib/index.test.js +++ b/test/lib/index.test.js @@ -1,5 +1,6 @@ 'use strict'; +const fs = require('fs'); const path = require('path'); const { @@ -44,6 +45,8 @@ console.log = jest.fn(); // Tests describe('createConfigFile', () => { it('should return the contents of our sample config with passed env variable', async () => { + jest.spyOn(fs, 'readFileSync').mockReturnValue(`{}`); + const { file, contents } = await createDefaultConfigFile('TEST_ENV_VAR'); expect(path.basename(file)).toEqual('.zapiergraphql');