Skip to content

Instantly share code, notes, and snippets.

@sbatson5
Created November 4, 2019 16:20
Show Gist options
  • Save sbatson5/337ff1775241e0a1dfd7d33de0fb3953 to your computer and use it in GitHub Desktop.
Save sbatson5/337ff1775241e0a1dfd7d33de0fb3953 to your computer and use it in GitHub Desktop.
Simple firebase mock
jest.mock('firebase', () => ({
firestore: jest.fn().mockReturnValue({
collection: jest.fn().mockReturnValue({
add: jest.fn().mockResolvedValue({
id: 'abc123'
})
})
})
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment