Skip to content

Update parse to version 1.9.0 🚀 #2233

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

Merged
merged 2 commits into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"mime": "1.3.4",
"mongodb": "2.1.18",
"multer": "1.1.0",
"parse": "1.8.5",
"parse": "1.9.0",
"parse-server-fs-adapter": "1.0.0",
"parse-server-push-adapter": "1.0.4",
"parse-server-s3-adapter": "1.0.3",
Expand Down
26 changes: 12 additions & 14 deletions spec/ParseHooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ var triggers = require('../src/triggers');
var HooksController = require('../src/Controllers/HooksController').default;
var express = require("express");
var bodyParser = require('body-parser');
// Inject the hooks API
Parse.Hooks = require("../src/cloud-code/Parse.Hooks");

var port = 12345;
var hookServerURL = "http://localhost:"+port;
Expand Down Expand Up @@ -55,7 +53,7 @@ describe('Hooks', () => {
expect(res.functionName).toBe("My-Test-Function");
expect(res.url).toBe("http://anotherurl")
// delete
return Parse.Hooks.deleteFunction("My-Test-Function")
return Parse.Hooks.removeFunction("My-Test-Function")
})
.then((res) => {
// Find again! but should be deleted
Expand All @@ -67,7 +65,7 @@ describe('Hooks', () => {
return Promise.resolve();
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe("no function named: My-Test-Function is defined")
expect(err.message).toBe("no function named: My-Test-Function is defined")
done();
return Promise.resolve();
})
Expand Down Expand Up @@ -104,7 +102,7 @@ describe('Hooks', () => {
expect(res.url).toBe("http://anotherurl")
expect(res.objectId).toBeUndefined();

return Parse.Hooks.deleteTrigger("MyClass","beforeDelete");
return Parse.Hooks.removeTrigger("MyClass","beforeDelete");
}, (err) => {
fail(err);
done();
Expand All @@ -121,7 +119,7 @@ describe('Hooks', () => {
expect(err).not.toBe(null);
expect(err).not.toBe(undefined);
expect(err.code).toBe(143);
expect(err.error).toBe("class MyClass does not exist")
expect(err.message).toBe("class MyClass does not exist")
done();
});
});
Expand Down Expand Up @@ -151,8 +149,8 @@ describe('Hooks', () => {
expect(err).not.toBe(undefined);
expect(err).not.toBe(null);
expect(err.code).toBe(143);
expect(err.error).toBe('function name: my_new_function already exits')
return Parse.Hooks.deleteFunction("my_new_function");
expect(err.message).toBe('function name: my_new_function already exits')
return Parse.Hooks.removeFunction("my_new_function");
}).then(() => {
done();
}, (err) => {
Expand All @@ -170,8 +168,8 @@ describe('Hooks', () => {
fail("should not be able to create the same trigger");
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe('class MyClass already has trigger beforeSave')
return Parse.Hooks.deleteTrigger("MyClass", "beforeSave");
expect(err.message).toBe('class MyClass already has trigger beforeSave')
return Parse.Hooks.removeTrigger("MyClass", "beforeSave");
}).then(() => {
done();
}, (err) => {
Expand All @@ -185,14 +183,14 @@ describe('Hooks', () => {
fail("Should not succeed")
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe('no function named: A_COOL_FUNCTION is defined');
expect(err.message).toBe('no function named: A_COOL_FUNCTION is defined');
return Parse.Hooks.getFunction("A_COOL_FUNCTION")
}).then( (res) => {
fail("the function should not exist");
done();
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe('no function named: A_COOL_FUNCTION is defined');
expect(err.message).toBe('no function named: A_COOL_FUNCTION is defined');
done();
});
});
Expand All @@ -202,14 +200,14 @@ describe('Hooks', () => {
fail("Should not succeed")
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe('class AClassName does not exist');
expect(err.message).toBe('class AClassName does not exist');
return Parse.Hooks.getTrigger("AClassName","beforeSave")
}).then( (res) => {
fail("the function should not exist");
done();
}, (err) => {
expect(err.code).toBe(143);
expect(err.error).toBe('class AClassName does not exist');
expect(err.message).toBe('class AClassName does not exist');
done();
});
});
Expand Down
132 changes: 0 additions & 132 deletions src/cloud-code/Parse.Hooks.js

This file was deleted.