Right before this import, there’s code which deletes global imports by searching for a line which has import and from '@jest/globals simultaneously. But the test file for robot-name has import and from on different lines.
So, if I’m not completely wrong here (which is likely, really), the global imports here are not deleted and there’s a redeclaration of beforeEach
P.S.: had this same problem when doing this exercise two weeks ago on the web test runner, so did it locally. My code (which passes all the tests) shows the same error when I run it on the web test runner.
Yes, the error must be with the tests + something running online;
empty solutions and the skeleton file also fail with the same error online, but my solution passes locally (using node in the terminal, I don’t have the CLI installed).
Maybe a possible fix could be collapsing the import to one line?
I don’t know enough about Exercism’s infrastructure to know whether that might cause some formatting error though.
This may be @SleeplessByte as he’s the one dealing with the web test runner, but I believe he’s onto it (coming from a different issue tho). Still, wouldn’t hurt to ping.
In the meantime, @oxe-b spot on debugging! Removing the global import from the tests file would likely solve the web test runner issue, but then the local test runner wouldn’t run… Also, you can’t edit the files before submitting.
@SneakyMallard The proper temporary solution would be to test and submit using the CLI. If the solution passes locally there shouldn’t be any problem with that workflow.
Y’all are correct. The replace in the web test runner is not correctly replacing over multiple lines. I knew it was going to be an issue eventually but .
Thanks for reporting!
@oxe-b replacing before splitting would be a solution but I really want to be able to see we commented it out, so the correct solution is to add /* before and */ after instead of // before.
Do you feel confident enough to try to PR it? The workflow to debug / test it is:
Make a change
Build
Copy the imported.mjs and worker files from output to sample
I’ve done the change, build, copy of files and serving. As for the testing, is it this fruit-picker.html? If so, the result is a pass with or without breaking the import into different lines.