forked from parse-community/parse-server-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTests.spec.js
More file actions
21 lines (19 loc) · 768 Bytes
/
Tests.spec.js
File metadata and controls
21 lines (19 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// E2E tests should be minimal and only test the integration of the Parse Server.
// Unit tests are preferred as they are faster and more reliable, and do not require a running Parse Server.
describe('Parse Server example', () => {
Parse.User.enableUnsafeCurrentUser();
it('call function', async () => {
const result = await Parse.Cloud.run('hello');
expect(result).toBe('Hi');
});
it('call async function', async () => {
const result = await Parse.Cloud.run('helloAsyncFunction');
expect(result).toBe('Hi async');
});
it('failing test', async () => {
const obj = new Parse.Object('TestObject');
await expectAsync(obj.save()).toBeRejectedWith(
new Parse.Error(9001, 'Saving test objects is not available.')
);
});
});