teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

Jest tester fails to parse the config file #94

Open alvarezGarciaMarcos opened 4 years ago

alvarezGarciaMarcos commented 4 years ago

Description

Jest gives a syntax error on the jest.config.js without even touching the configuration file.

Specifications

alvarezGarciaMarcos commented 4 years ago

The error itself is this one Jest failure Command failed: "/usr/local/bin/node" /home/marcos/Documentos/Programming/react-components/.bit/components/testers/jest/bit.envs/22.4.3/node_modules/jest/bin/jest.js dist/src/tests/InputText.test.js --rootDir=dist/src/tests --config=/home/marcos/Documentos/Programming/react-components/.bit/components/testers/jest/bit.envs/22.4.3/dist/jest.config.js --json --outputFile="InputText-results.json" Unrecognized options: rootDir Error: Jest: Failed to parse config file /home/marcos/Documentos/Programming/react-components/.bit/components/testers/jest/bit.envs/22.4.3/dist/jest.config.js Error: Parse error on line 1: "use strict";module.exports = ------------^ Expecting 'EOF', '}', ':', ',', ']', got 'undefined' at Object.parseError (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/vendor/jsonlint.js:57:19) at Object.parse (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/vendor/jsonlint.js:134:30) at Object.exports.parse (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/vendor/jsonlint.js:420:56) at Object.exports.errors (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/vendor/jsonlint.js:419:50) at parse (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/loadFromFile.js:23:32) at /home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/loadFromFile.js:31:20 at parse (/home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/loadFromFile.js:24:15) at /home/marcos/Documentos/Programming/react-components/node_modules/jest-config/build/loadFromFile.js:31:20 "/usr/local/bin/node" /home/marcos/Documentos/Programming/react-components/.bit/components/testers/jest/bit.envs/22.4.3/node_modules/jest/bin/jest.js dist/src/tests/InputText.test.js --rootDir=dist/src/tests --config=/home/marcos/Documentos/Programming/react-components/.bit/components/testers/jest/bit.envs/22.4.3/dist/jest.config.js --json --outputFile="InputText-results.json" (exited with error code 1)

GiladShoham commented 4 years ago

We plan to re-write jest tester from scratch. it's not very stable and updated right now. It will probably take a few weeks, but it will be much better, performant and stable.

alextuppen commented 4 years ago

@GiladShoham any news on the re-write? I'd need to use the Jest tester but I need to follow the vague instructions here https://discourse.bit.dev/t/can-i-modify-a-build-test-environments/28 and if there is a new version coming I'd rather wait for that first rather than modify something that is already out of date.

GiladShoham commented 4 years ago

@Exitialis1 We almost done with the re-write, but we re-write it based on a complete new extensions infrastructure that will be out in the next major version of bit. It's now much faster and better and much more stable. There is also another version with some minor changes I did for someone (which also support snapshots), but it's pretty new and not well tested / production ready yet. But you can play with it here - https://bit.dev/giladshoham/for-krazybee/testers/jest (It's not the same one we were re-write, just something quick to support screenshots) Also @JoshK2 was looking on the jest recently. maybe he has some inputs.