console-fail-test
Version:
Gently fails test runs if the console was used during them. 📢
1 lines • 1.29 kB
Source Map (JSON)
{"version":3,"sources":["../../src/environments/jest.ts"],"sourcesContent":["import { TestFrameworkSelector } from \"./testEnvironmentTypes.js\";\n\ndeclare const afterEach: (callback: () => void) => void;\ndeclare const beforeEach: (callback: () => void) => void;\ndeclare const jest: unknown;\n\nexport const selectJestEnvironment: TestFrameworkSelector = () => {\n\tif (\n\t\ttypeof afterEach === \"undefined\" ||\n\t\ttypeof beforeEach === \"undefined\" ||\n\t\ttypeof jest === \"undefined\"\n\t) {\n\t\treturn undefined;\n\t}\n\n\tlet afterEachCallback: (() => void) | undefined;\n\tlet beforeEachCallback: (() => void) | undefined;\n\n\tafterEach(() => {\n\t\tafterEachCallback?.();\n\t});\n\n\tbeforeEach(() => {\n\t\tbeforeEachCallback?.();\n\t});\n\n\treturn {\n\t\tafterEach: (callback) => {\n\t\t\tafterEachCallback = callback;\n\t\t},\n\t\tbeforeEach: (callback) => {\n\t\t\tbeforeEachCallback = callback;\n\t\t},\n\t};\n};\n"],"mappings":"AAMO,MAAM,wBAA+C,MAAM;AACjE,MACC,OAAO,cAAc,eACrB,OAAO,eAAe,eACtB,OAAO,SAAS,aACf;AACD,WAAO;AAAA,EACR;AAEA,MAAI;AACJ,MAAI;AAEJ,YAAU,MAAM;AACf,wBAAoB;AAAA,EACrB,CAAC;AAED,aAAW,MAAM;AAChB,yBAAqB;AAAA,EACtB,CAAC;AAED,SAAO;AAAA,IACN,WAAW,CAAC,aAAa;AACxB,0BAAoB;AAAA,IACrB;AAAA,IACA,YAAY,CAAC,aAAa;AACzB,2BAAqB;AAAA,IACtB;AAAA,EACD;AACD;","names":[]}