Inclusion Mode
Last updated
Last updated
Sometimes, you have an existing spartacus project, where you don't want or cannot add mock-data for everything. Still it would be nice to quickly mock a page with a new component / a new endpoint. Don't worry, we have you covered:
Add the property inclusionMode: true
to the mockConfig in your main.ts
file
Follow the steps described in and / or to add a route / handler for your endpoint
Define an Array where you specify the request that you want to mock (this is needed, as in Inclusion Mode, all requested go through by default)
Add everything to your mockConfig
Add the property inclusionMode: true
to the mockConfig in your main.ts
file
Define an Array where you specify the request that you want to mock (this is needed, as in the Inclusion Mode, all requested go through by default)
Define a string array with the pageId
of the page that you want to mock (this is needed, as for the other pages, the pages
call still needs to go through)mockedPageIds: ['hello-world']
Add everything to your mockConfig
Follow the steps described in to add a custom page