From 0c64b03202f4e41b50be3411a85573cf73538465 Mon Sep 17 00:00:00 2001 From: ibuibu Date: Mon, 7 Nov 2022 09:54:09 +0900 Subject: [PATCH] Add a test --- .../jest-config/src/__tests__/normalize.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/jest-config/src/__tests__/normalize.test.ts b/packages/jest-config/src/__tests__/normalize.test.ts index 9e70d96dd220..93b580afd6f9 100644 --- a/packages/jest-config/src/__tests__/normalize.test.ts +++ b/packages/jest-config/src/__tests__/normalize.test.ts @@ -101,6 +101,23 @@ it('keeps custom project id based on the projects rootDir', async () => { ); }); +it('validation warning occurs when options not for projects is set', async () => { + const mockWarn = jest.mocked(console.warn).mockImplementation(() => {}); + const rootDir = '/root/path/foo'; + const {options} = await normalize( + { + bail: true, // an option not for projects + rootDir, + }, + {} as Config.Argv, + rootDir, + 1, + true, // isProjectOptions + ); + + expect(mockWarn).toHaveBeenCalledTimes(1); +}); + it('keeps custom ids based on the rootDir', async () => { const {options} = await normalize( {