Skip to content

test: adding new test for error handling of ALREADY_EXISTS error #2084

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,14 @@ describe('DocumentReference class', () => {

unlisten();
});

it('will error on create if document already exists', async () => {
const ref = randomCol.doc();
await ref.create({});
return expect(ref.create({})).to.be.eventually.rejectedWith(
/already exists/
);
});
});

describe('runs query on a large collection', () => {
Expand Down
Loading