diff --git a/__tests__/check-tsconfig.spec.ts b/__tests__/check-tsconfig.spec.ts index f56fe2d..3e77e39 100644 --- a/__tests__/check-tsconfig.spec.ts +++ b/__tests__/check-tsconfig.spec.ts @@ -10,19 +10,24 @@ const defaultConfig = { fileNames: [], errors: [], options: {} }; test("checkTsConfig", () => { expect(() => checkTsConfig({ - ...defaultConfig, - options: { module: ts.ModuleKind.None }, - })).toThrow( - "Incompatible tsconfig option. Module resolves to 'None'. This is incompatible with Rollup, please use", - ); - - expect(checkTsConfig({ ...defaultConfig, options: { module: ts.ModuleKind.ES2015 }, - })).toBeFalsy(); + })).not.toThrow(); - expect(checkTsConfig({ + expect(() => checkTsConfig({ + ...defaultConfig, + options: { module: ts.ModuleKind.ES2020 }, + })).not.toThrow(); + + expect(() => checkTsConfig({ ...defaultConfig, options: { module: ts.ModuleKind.ESNext }, - })).toBeFalsy(); + })).not.toThrow(); +}); + +test("checkTsConfig - errors", () => { + expect(() => checkTsConfig({ + ...defaultConfig, + options: { module: ts.ModuleKind.None }, + })).toThrow("Incompatible tsconfig option. Module resolves to 'None'. This is incompatible with Rollup, please use"); });