diff --git a/global.config.js b/global.config.js index aacca1c..63f1dd9 100644 --- a/global.config.js +++ b/global.config.js @@ -20,6 +20,7 @@ global.document.documentElement.style['grid-column-gap'] = true var spy = jest.spyOn(console, 'error') beforeAll(function () { spy.mockImplementation(function (message) { + // eslint-disable-next-line no-console console.log(message) throw new Error(message) }) diff --git a/global.config.js.map b/global.config.js.map deleted file mode 100644 index 2a6921c..0000000 --- a/global.config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.config.js","sourceRoot":"","sources":["global.config.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAM,CAAC,cAAc,CAAC,GAAG,uBAAY,CAAA;AAErC,MAAM,CAAC,OAAO,CAAC,GAAG,UAAC,IAAI;IACrB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,IAAK,OAAA,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAzB,CAAyB,CAAC,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,uBAAuB,CAAC,GAAG,UAAC,EAAE,IAAK,OAAA,UAAU,CAAC,EAAE,CAAC,EAAd,CAAc,CAAA;AAExD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAG9D;AAAA,CAAC;IACA,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACxC,SAAS,CAAC;QACR,GAAG,CAAC,kBAAkB,CAAC,UAAC,OAAO;YAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC;QACP,GAAG,CAAC,WAAW,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,EAAE,CAAA","sourcesContent":["import prettyFormat from 'pretty-format'\n\nglobal['prettyFormat'] = prettyFormat\n\nglobal['sleep'] = (time) => {\n return new Promise((resolve) => setTimeout(resolve, time))\n}\n\nglobal['requestAnimationFrame'] = (fn) => setTimeout(fn)\n\nglobal.document.documentElement.style['grid-column-gap'] = true\n\n// 把 console.error 转换成 error,方便断言\n;(() => {\n const spy = jest.spyOn(console, 'error')\n beforeAll(() => {\n spy.mockImplementation((message) => {\n console.log(message)\n throw new Error(message)\n })\n })\n\n afterAll(() => {\n spy.mockRestore()\n })\n})()\n"]} \ No newline at end of file diff --git a/global.config.ts b/global.config.ts index 7b968bd..d9c72f7 100644 --- a/global.config.ts +++ b/global.config.ts @@ -15,6 +15,7 @@ global.document.documentElement.style['grid-column-gap'] = true const spy = jest.spyOn(console, 'error') beforeAll(() => { spy.mockImplementation((message) => { + // eslint-disable-next-line no-console console.log(message) throw new Error(message) })