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

Datastore Amplify Mock Support #104

Open
2 tasks
diegoconcha opened this issue Feb 24, 2022 · 6 comments
Open
2 tasks

Datastore Amplify Mock Support #104

diegoconcha opened this issue Feb 24, 2022 · 6 comments
Labels

Comments

@diegoconcha
Copy link

Is this feature request related to a new or existing Amplify category?

No response

Is this related to another service?

Datastore

Describe the feature you'd like to request

My team and I spent a week getting excited about and integrating datastore into our app only to find out when trying to test it locally that it doesn't work with amplify mock so we ended up having to rip it out. This would be an awesome improvement as testing on the cloud is slow especially between deploys.

Describe the solution you'd like

We're approach agnostic as long as amplify mock works with datastore :).

Describe alternatives you've considered

Not using datastore and having to wrangle app state and backend state manually.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@josefaidt
Copy link
Contributor

Hey @diegoconcha 👋 thanks for taking the time to file this one as well 🙂 marking as a feature request

@alharris-at alharris-at transferred this issue from aws-amplify/amplify-cli May 17, 2022
@ArmanNisch
Copy link

+1

1 similar comment
@RemyNtshaykolo
Copy link

+1

@raymondht
Copy link

+1. I'm surprised that this is not supported. What's the best practice for developing with Datastore locally? If we need to rely on a cloud Dev environment, it's slow and not really cost-effective.

What if there are multiple developers working on the same project? Does each of them need to create a cloud environment for their branch? Is this a cost-effective approach?

Keen to learn more about this 🙏

@fideldalmasso
Copy link

Any update on this? mocking and testing my DataStore app locally would be very useful

@talaikis
Copy link

jest.mock('aws-amplify/datastore', () => ({
  DataStore: {
    configure: jest.fn()
  },
  initSchema: jest.fn().mockImplementation((schema) => ({
    Update: jest.fn(),
    Upstream: jest.fn(),
    Message: jest.fn()
  })),
  DISCARD: {}
}))

etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants