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

Not really a issue but more of a question. #57

Open
cesarpatrick opened this issue Dec 22, 2023 · 2 comments
Open

Not really a issue but more of a question. #57

cesarpatrick opened this issue Dec 22, 2023 · 2 comments

Comments

@cesarpatrick
Copy link

Hi guys, I'm working in a project now using the Sparatacus, I found this library and I thought was promising but I was not able to get working yet, following the documentation but when I add the library to the project but not all the files listed that would change after that did not change I got the angular.json modified and the mockServiceworker.js only is that ok ? One more question is when I want to use one of the handles and mock data OOTB made by you guys, there is a service class or something to me point to in my feature to know that rather make the original request to the server then call the mock. The last thing I noticed even after added MockConfig on my main.ts I still not getting the [MSW] Mocking enabled when I'm running the spartacus project. Thank you so much.

@janwidmer
Copy link
Collaborator

janwidmer commented Jan 5, 2024

Hi @cesarpatrick,
Which versions are you using for?

  1. node
  2. angular
  3. spartacus
  4. spartacus-mock

Did you run ng add @valantic/spartacus-mock? Did it show any errors in the console?

We have just published version 3.1.0 of spartacus-mock, working with the latest mws version, spartacus 6.7.0 and angular 15. The latest version adds more automatically generated files to help you getting started.

Out of the box, all requests for the standard electronics store https://spartacus-demo.eastus.cloudapp.azure.com/electronics-spa/en/USD/ are mocked.

After a successful setup, you should have several files being generated, see here: https://github.com/valantic/spartacus-mock/blob/main/docs/getting-started/installation.md

If the schematics (running ng add @valantic/spartacus-mock) do not work for you, you can aswell just run npm i -d @valantic/spartacus-mock@3.1.0 to install it and then copy / create the files manually.

You can also check this example project, this is how it should look like after the successful setup: https://github.com/janwidmer/spartacus-test-6.7.0/tree/main/src/mock-server. if you clone this test project, you should see spartacus-mock running:

  1. Checkout Repo
  2. Make sure, you run node version 18.18.0
  3. Run npm i
  4. Run npm run start
  5. Open Browser URL http://localhost:4200/electronics-spa/de/USD/

@janwidmer
Copy link
Collaborator

@cesarpatrick we have released another version having more detailed installation docs: https://valantic.gitbook.io/spartacus-mock/getting-started/installation

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

No branches or pull requests

2 participants