Skip to content

Add unit test towards #494 #497

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

Closed
wants to merge 1 commit into from
Closed
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 integration/test/ParseObjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ describe('Parse Object', () => {
});
});

it('cannot set an invalid date', (done) => {
let obj = new TestObject();
obj.set('when', new Date(Date.parse(null)));
Parse.Object.saveAll([obj]).fail((e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually succeeds , but failed the CI as the done() is never called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed this along with the other PR. This test passes after PR #495. So, we know that the unit test covers this fail condition. However, coverage is still down. What should I do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should also mention that I copy pasted this test case from just above this unit test. That one invokes save instead of saveAll, and passes. It is the saveAll that was misbehaving.

done();
});
});

it('cannot create invalid class names', (done) => {
let item = new Parse.Object('Foo^Bar');
item.save().fail((e) => {
Expand Down