Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default Jest config in new project template #289

Merged
merged 3 commits into from
Apr 30, 2021
Merged

Added default Jest config in new project template #289

merged 3 commits into from
Apr 30, 2021

Conversation

pozil
Copy link
Contributor

@pozil pozil commented Mar 25, 2021

This PR adds a minimal Jest configuration that's compatible with LWC.
This allows VSCode Jest extensions and VSCode debugger to run.
I've excluded the local dev server so that it's not included in Jest code code coverage.

FYI @albarivas

@pozil pozil requested a review from a team as a code owner March 25, 2021 13:20
@brpowell
Copy link

Hi @pozil. Are you looking to add this file to the standard project:create template?

@pozil
Copy link
Contributor Author

pozil commented Apr 28, 2021

Hi @brpowell. Yes, that's my intent.

@brpowell
Copy link

Cool. You'll need to move this file to the project template folder here:

https://github.com/forcedotcom/salesforcedx-templates/tree/develop/packages/templates/src/templates/project

Then make sure the project generator copies it here:

And then validate that the file is copied correctly in the test case here:

https://github.com/forcedotcom/salesforcedx-templates/blob/develop/packages/plugin-templates/test/commands/project/create.test.ts

@pozil
Copy link
Contributor Author

pozil commented Apr 28, 2021

Thanks for the guidance @brpowell. I applied your comments.

@pozil pozil changed the title Added default Jest config Added default Jest config in new project template Apr 29, 2021
@brpowell brpowell self-assigned this Apr 29, 2021
@brpowell
Copy link

@pozil I tested project create, npm install, creating a test and running it - everything looks good 👍 . I'll run the builds so we can get this merged and released for next week.

Does it make sense to put this jest config in the lwc folder with the rest of the LWC specific configuration? (eslint, jsconfig) I'm not too familiar with valid LWC project structure, maybe it is better at the root but thought I would ask.

@pozil
Copy link
Contributor Author

pozil commented Apr 30, 2021

Thanks for testing @brpowell. We really need that file at the project root for VS Code debugging and Jest extensions to work.

@brpowell brpowell merged commit ffce4ed into forcedotcom:develop Apr 30, 2021
xyc pushed a commit that referenced this pull request May 10, 2021
* feat: added default jest config in new project template (#289)

* docs: add semvar info to publishing doc (#312)

* chore: remove codecov.io (#315)

* fix: add *.app to eslintignore (#313)

* feat(gitignore): add dotenv files (#314)

* add code folders to analytics projects  (#316)

* fix: update .nvmrc to match volta config

* feat: add code folders to analytics projects

This is aura/, classes/, and lwc/, plus the corresponding eslint configs.
Also adds the analytics vscode extension to the extension recommendations.

* build: upgrade dependencies (#317)

* build: update nyc in packages/templates
* build: update lerna
* build: update commitlint deps
* build: upgrade yeoman packages

Co-authored-by: Philippe Ozil <[email protected]>
Co-authored-by: Shelby Holden <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Jonathan Wiesel <[email protected]>
Co-authored-by: Greg Smith <[email protected]>
Co-authored-by: Bryan Powell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants