dom-testing-library-template icon indicating copy to clipboard operation
dom-testing-library-template copied to clipboard

Fails with `Identifier 'test' has already been declared`

Open mischnic opened this issue 5 years ago • 2 comments

(Without any changes)

Identifier 'test' has already been declared

SyntaxError: Identifier 'test' has already been declared
    at eval (<anonymous>)
    at Eo (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:201748)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218712)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245871)
    at t (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218427)
    at evaluate (https://51uok.csb.app/node_modules/pretty-format/build/index.js:8:3)
    at Eo (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:201752)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218712)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245871)
    at t (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218427)
    at evaluate (https://51uok.csb.app/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js:567:26)
    at Eo (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:201752)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218712)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245871)
    at t (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218427)
    at evaluate (https://51uok.csb.app/node_modules/@testing-library/react/dist/@testing-library/react.esm.js:44:17)
    at Eo (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:201752)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218712)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245871)
    at t (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218427)
    at evaluate (https://51uok.csb.app/src/__tests__/index.test.js:7:15)
    at Eo (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:201752)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:218712)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245871)
    at e.value (https://codesandbox.io/static/js/sandbox.55f5df20e.js:1:245491)
    at https://codesandbox.io/static/js/jest-lite.fe1609ac0.chunk.js:1:15520
    at l (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:255733)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:255486)
    at Generator.forEach.e.<computed> [as next] (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:256090)
    at t (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2405)
    at i (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2616)
    at https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2675
    at new Promise (<anonymous>)
    at https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2556
    at https://codesandbox.io/static/js/jest-lite.fe1609ac0.chunk.js:1:15876
    at Array.map (<anonymous>)
    at e.<anonymous> (https://codesandbox.io/static/js/jest-lite.fe1609ac0.chunk.js:1:15224)
    at l (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:255733)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:255486)
    at Generator.forEach.e.<computed> [as next] (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:256090)
    at t (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2405)
    at i (https://codesandbox.io/static/js/common-sandbox.26857ffcc.chunk.js:1:2616)

mischnic avatar Sep 10 '20 19:09 mischnic

Thanks for the report. I've noticed this a couple of times but couldn't determine why. I reported it to codesandbox as well (https://github.com/codesandbox/codesandbox-client/issues/4887) since it's the only environment where I could reproduce the issue.

eps1lon avatar Sep 11 '20 12:09 eps1lon

https://codesandbox.io/s/constate-test-bb0gk Same error

tolgaduzenli avatar Oct 05 '20 12:10 tolgaduzenli