Coder Social home page Coder Social logo

valantic / spartacus-mock Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 0.0 1.69 MB

This project offers you the possibility, to mock the OCC Endpoints of your Composable Storefront (Spartacus). It uses the Mock Service Worker to mock the API calls.

License: MIT License

JavaScript 0.59% TypeScript 99.39% Shell 0.03%
spartacus spartacus-storefront valantic composable-storefront spartacus-mock

spartacus-mock's Introduction

SpartacusMock

This project offers you the possibility, to mock the API (OCC) Endpoints of your Composable-Storefront (Spartacus). It uses the Mock Service Worker (MSW) library to mock the API calls.

Developer Documentation

The developer documentation can be found here.

GitHub issues

If you encounter a problem with this library or if you have a new feature you'd like to see in this project, please create a new issue.

Contribution Guidelines

The contribution guidelines can be found here.

spartacus-mock's People

Contributors

claudio147 avatar janwidmer avatar janwidmer-work avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spartacus-mock's Issues

Add option to use it with an existing Project

For existing Projects, it would be good, if only certain Endpoints could be mocked and the rest will be taken from a local hybris / dev endpoint.

Add logic and enhance docs for that case

New Features with MSW 2.0

Check the following new features with MSW 2.0:

  1. worker.start option quiet: true to disable all logging, https://mswjs.io/docs/api/setup-worker/start#quiet => #62
  2. scenarios to test success & error case, https://mswjs.io/docs/best-practices/dynamic-mock-scenarios
  3. check if network behavior overrides can / should be used, https://mswjs.io/docs/best-practices/network-behavior-overrides
  4. check if mock sync methods should be used, https://mswjs.io/docs/recipes/keeping-mocks-in-sync
  5. check if conditional import can be improved, https://mswjs.io/docs/integrations/browser#conditionally-enable-mocking => done

Improve Usage Workflow

Try to improve the usage workflow by

  • Not needing to install msw in the actual spartacus Project
  • Not needing to call mws save initially
  • Add enhancements to angular.json automatically
  • Add enhancements to main.ts automatically

Not really a issue but more of a question.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.