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

Remove old mock generation logic, rename mocks --> stubs #53

Merged
merged 4 commits into from
May 4, 2019

Conversation

trevor-bliss
Copy link
Contributor

We generate the stubs from an internal script now so the current metadatfile and script are outdated.

Also update the README.

README.md Outdated

When this package is installed, a new set of mocks for all `lightning` namespaced components is generated into the `lightning-mocks` folder. These mocks are generated based off the `lwc-standard.json` metadata file. The mocks are auto-generated and the Jest resolver automatically uses these mocks in the tests. These work out-of-the-box, you don't need to do anything.
This package ships with stubs for the `lightning` base components. They are located in the `src/lightning-stubs` directory. These stubs will automatically get used when running tests through `lwc-jest`. You can override the default provided stub for your project by overriding the `moduleNameMapper` config as described below in the [Other Component Mocks](#other-component-mocks) section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package installs stubs for the lightning base components to the src/lightning-stubs directory. These stubs are used automatically when running tests through lwc-jest. To override the default stub provided for your project, override the moduleNameMapper config as described in Other Component Mocks.

README.md Outdated
@@ -108,7 +108,7 @@ lwc-jest --debug -- --no-cache
If you prefer to debug inside Visual Studio Code, follow these steps:
- From the Visual Studio Code dropdowns, select Debug > Add Configuration....
- If you're prompted for an Environment choose any value.
- Replace the contents of the generated `launch.json` with the following.
- Replace the contents of the generated `launch.json` with the following (for Windows users see the [Jest website](https://jestjs.io/docs/en/troubleshooting#debugging-in-vs-code) for launch.json contents).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mac users, replace the contents of the generated launch.json with the following. (Windows users, see the Jest website for launch.json contents).

@trevor-bliss trevor-bliss merged commit 970696e into master May 4, 2019
@trevor-bliss trevor-bliss deleted the tbliss/remove-old-mock-generation branch May 4, 2019 21:19
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