Skip to content

Commit 4da46a6

Browse files
committed
Merge remote-tracking branch 'ParsePlatform/master'
* ParsePlatform/master: (100 commits) Only allow basic auth credentials with a known appId (parse-community#2574) vk.com provider registered (parse-community#2579) chore(package): update parse-server-push-adapter to version 1.1.0 (parse-community#2588) vk.com auth data manager implemented (parse-community#2578) Fix a typo (parse-community#2563) Makes sure routes don't overlap and yield a header set error (parse-community#2559) Postgres: $all, $and CLP and more (parse-community#2551) Changelog 2.2.18 (parse-community#2558) chore(package): update winston-daily-rotate-file to version 1.3.0 (parse-community#2547) chore(package): update parse-server-s3-adapter to version 1.0.5 (parse-community#2536) Adds bcrypt native binding for better login performance (parse-community#2549) chore(package): update mongodb to version 2.2.7 (parse-community#2554) Make parse-server cloud code logging closer parse.com legacy (parse-community#2550) chore(package): update pg-promise to version 5.3.1 (parse-community#2519) Postgres: Operations, Hooks, OAuth login, Files support (parse-community#2528) Syncing afterSave/afterDelete trigger calls (Issue parse-community#2489) (parse-community#2499) Updated README.md (parse-community#2538) Fix capitalization, typo, and grammar mistake (parse-community#2533) Update ISSUE_TEMPLATE.md fix typo (parse-community#2525) ...
2 parents b9e0302 + 2aa14ad commit 4da46a6

File tree

115 files changed

+4828
-1622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4828
-1622
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Please include a detailed list of steps that reproduce the issue. Include curl c
4949
### Environment Setup
5050

5151
- **Server**
52-
- parse-server version: [FILL THIS OUT]
52+
- parse-server version (Be specific! Don't say 'latest'.) : [FILL THIS OUT]
5353
- Operating System: [FILL THIS OUT]
5454
- Hardware: [FILL THIS OUT]
5555
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [FILL THIS OUT]

.istanbul.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
instrumentation:
2+
excludes: ["**/spec/**"]

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ services:
77
addons:
88
postgresql: '9.4'
99
before_script:
10+
- ls -al "$HOME/.mongodb/versions"
1011
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
12+
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database
13+
- psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d parse_server_postgres_adapter_test_database
1114
env:
1215
global:
13-
- COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**'
16+
- COVERAGE_OPTION='./node_modules/.bin/istanbul cover'
1417
matrix:
1518
- PARSE_SERVER_TEST_DB=postgres
1619
- MONGODB_VERSION=2.6.11
@@ -24,8 +27,10 @@ branches:
2427
- /^[0-9]+.[0-9]+.[0-9]+(-.*)?$/
2528
cache:
2629
directories:
27-
- "$HOME/.mongodb/versions/downloads"
28-
after_script: "./node_modules/.bin/codecov"
30+
- node_modules
31+
- "$HOME/.mongodb/versions"
32+
after_script:
33+
- bash <(curl -s https://codecov.io/bash)
2934
deploy:
3035
provider: npm
3136
email:

2.3.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Upgrading Parse Server to version 2.3.0
22

3-
Parse Server version 2.3.0 begins using unique indexes to ensure User's username and email are unique. This is not a backwards incompatable change, but it may in some cases cause a significant performance regression until the index finishes building. Building the unique index before upgrading your Parse Server version will eliminate the performance impact, and is a recommended step before upgrading any app to Parse Server 2.3.0. New apps starting with version 2.3.0 do not need to take any steps before beginning their project.
3+
Parse Server version 2.3.0 begins using unique indexes to ensure the User's username and email are unique. This is not a backwards incompatible change, but it may in some cases cause a significant performance regression until the index finishes building. Building the unique index before upgrading your Parse Server version will eliminate the performance impact, and is a recommended step before upgrading any app to Parse Server 2.3.0. New apps starting with version 2.3.0 do not need to take any steps before beginning their project.
44

55
If you are using MongoDB in Cluster or Replica Set mode, we recommend reading Mongo's [documentation on index building](https://docs.mongodb.com/v3.0/tutorial/build-indexes-on-replica-sets/) first. If you are not using these features, you can execute the following commands from the Mongo shell to build the unique index. You may also want to create a backup first.
66

@@ -58,7 +58,7 @@ In this case, you will need to remove the incorrect index. If your app relies on
5858

5959
## There is already non-unique data in the username or email field
6060

61-
This is possible if you have explicitly set some user's emails to null. If this is bogus data, and those null fields shoud be unset, you can unset the null emails with this command. If your app relies on the difference between null and unset emails, you will need to upgrade your app to treat null and unset emails the same before building the index and upgrading to Parse Server 2.3.0.
61+
This is possible if you have explicitly set some user's emails to null. If this is bogus data, and those null fields should be unset, you can unset the null emails with this command. If your app relies on the difference between null and unset emails, you will need to upgrade your app to treat null and unset emails the same before building the index and upgrading to Parse Server 2.3.0.
6262

6363
```js
6464
coll.update({ email: { $exists: true, $eq: null } }, { $unset: { email: '' } }, { multi: true })

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
11
## Parse Server Changelog
22

3+
### 2.2.18
4+
5+
* Fix: Improve support for objects in push alert, thanks to [Antoine Lenoir](https://github.com/alenoir)
6+
* Fix; Prevent pointed from getting clobbered when they are changed in a beforeSave, thanks to [sud](https://github.com/sud80)
7+
* Fix: Improve support for "Bytes" type, thanks to [CongHoang](https://github.com/conghoang)
8+
* Fix: Better logging compatability with Parse.com, thanks to [Arthur Cinader](https://github.com/acinader)
9+
* New: Add Janrain Capture and Janrain Engage auth provider, thanks to [Andrew Lane](https://github.com/AndrewLane)
10+
* Improved: Include content length header in files response, thanks to [Steven Van Bael](https://github.com/vbsteven)
11+
* Improved: Support byte range header for files, thanks to [Brage G. Staven](https://github.com/Bragegs)
12+
* Improved: Validations for LinkedIn access_tokens, thanks to [Felix Dumit](https://github.com/felix-dumit)
13+
* Improved: Experimental postgres support, thanks to [Florent Vilmart](https://github.com/flovilmart)
14+
* Perf: Use native bcrypt implementation if available, thanks to [Florent Vilmart](https://github.com/flovilmart)
15+
16+
17+
### [2.2.17](https://github.com/ParsePlatform/parse-server/tree/2.2.17) (07/23/2016)
18+
[Full Changelog](https://github.com/ParsePlatform/parse-server/compare/2.2.16...2.2.17)
19+
20+
* Cloud code logs [\#2370](https://github.com/ParsePlatform/parse-server/pull/2370) ([flovilmart](https://github.com/flovilmart))
21+
* Make sure \_PushStatus operations are run in order [\#2367](https://github.com/ParsePlatform/parse-server/pull/2367) ([flovilmart](https://github.com/flovilmart))
22+
* Typo fix for error message when can't ensure uniqueness of user email addresses [\#2360](https://github.com/ParsePlatform/parse-server/pull/2360) ([AndrewLane](https://github.com/AndrewLane))
23+
* LiveQuery constrains matching fix [\#2357](https://github.com/ParsePlatform/parse-server/pull/2357) ([simonas-notcat](https://github.com/simonas-notcat))
24+
* Fix typo in logging for commander parseConfigFile [\#2352](https://github.com/ParsePlatform/parse-server/pull/2352) ([AndrewLane](https://github.com/AndrewLane))
25+
* Fix minor typos in test names [\#2351](https://github.com/ParsePlatform/parse-server/pull/2351) ([acinader](https://github.com/acinader))
26+
* Makes sure we don't strip authData or session token from users using masterKey [\#2348](https://github.com/ParsePlatform/parse-server/pull/2348) ([flovilmart](https://github.com/flovilmart))
27+
* Run coverage with istanbul [\#2340](https://github.com/ParsePlatform/parse-server/pull/2340) ([flovilmart](https://github.com/flovilmart))
28+
* Run next\(\) after successfully sending data to the client [\#2338](https://github.com/ParsePlatform/parse-server/pull/2338) ([blacha](https://github.com/blacha))
29+
* Cache all the mongodb/version folder [\#2336](https://github.com/ParsePlatform/parse-server/pull/2336) ([flovilmart](https://github.com/flovilmart))
30+
* updates usage of setting: emailVerifyTokenValidityDuration [\#2331](https://github.com/ParsePlatform/parse-server/pull/2331) ([cherukumilli](https://github.com/cherukumilli))
31+
* Update Mongodb client to 2.2.4 [\#2329](https://github.com/ParsePlatform/parse-server/pull/2329) ([flovilmart](https://github.com/flovilmart))
32+
* Allow usage of analytics adapter [\#2327](https://github.com/ParsePlatform/parse-server/pull/2327) ([deashay](https://github.com/deashay))
33+
* Fix flaky tests [\#2324](https://github.com/ParsePlatform/parse-server/pull/2324) ([flovilmart](https://github.com/flovilmart))
34+
* don't serve null authData values [\#2320](https://github.com/ParsePlatform/parse-server/pull/2320) ([yuzeh](https://github.com/yuzeh))
35+
* Fix null relation problem [\#2319](https://github.com/ParsePlatform/parse-server/pull/2319) ([flovilmart](https://github.com/flovilmart))
36+
* Clear the connectionPromise upon close or error [\#2314](https://github.com/ParsePlatform/parse-server/pull/2314) ([flovilmart](https://github.com/flovilmart))
37+
* Report validation errors with correct error code [\#2299](https://github.com/ParsePlatform/parse-server/pull/2299) ([flovilmart](https://github.com/flovilmart))
38+
* Parses correctly Parse.Files and Dates when sent to Cloud Code Functions [\#2297](https://github.com/ParsePlatform/parse-server/pull/2297) ([flovilmart](https://github.com/flovilmart))
39+
* Adding proper generic Not Implemented. [\#2292](https://github.com/ParsePlatform/parse-server/pull/2292) ([vitaly-t](https://github.com/vitaly-t))
40+
* Adds schema caching capabilities \(5s by default\) [\#2286](https://github.com/ParsePlatform/parse-server/pull/2286) ([flovilmart](https://github.com/flovilmart))
41+
* add digits oauth provider [\#2284](https://github.com/ParsePlatform/parse-server/pull/2284) ([ranhsd](https://github.com/ranhsd))
42+
* Improve installations query [\#2281](https://github.com/ParsePlatform/parse-server/pull/2281) ([flovilmart](https://github.com/flovilmart))
43+
* Adding request headers to cloud functions fixes \#1461 [\#2274](https://github.com/ParsePlatform/parse-server/pull/2274) ([blacha](https://github.com/blacha))
44+
* Creates a new sessionToken when updating password [\#2266](https://github.com/ParsePlatform/parse-server/pull/2266) ([flovilmart](https://github.com/flovilmart))
45+
* Add Gitter chat link to the README. [\#2264](https://github.com/ParsePlatform/parse-server/pull/2264) ([nlutsenko](https://github.com/nlutsenko))
46+
* Restores ability to include non pointer keys [\#2263](https://github.com/ParsePlatform/parse-server/pull/2263) ([flovilmart](https://github.com/flovilmart))
47+
* Allow next middleware handle error in handleParseErrors [\#2260](https://github.com/ParsePlatform/parse-server/pull/2260) ([mejcz](https://github.com/mejcz))
48+
* Exposes the ClientSDK infos if available [\#2259](https://github.com/ParsePlatform/parse-server/pull/2259) ([flovilmart](https://github.com/flovilmart))
49+
* Adds support for multiple twitter auths options [\#2256](https://github.com/ParsePlatform/parse-server/pull/2256) ([flovilmart](https://github.com/flovilmart))
50+
* validate\_purchase fix for SANDBOX requests [\#2253](https://github.com/ParsePlatform/parse-server/pull/2253) ([valeryvaskabovich](https://github.com/valeryvaskabovich))
51+
352
### 2.2.16 (7/10/2016)
453

554
* New: Expose InMemoryCacheAdapter publicly, thanks to [Steven Shipton](https://github.com/steven-supersolid)

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,25 @@ PARSE_SERVER_LOGS_FOLDER='<path-to-logs-folder>' parse-server --appId APPLICATIO
218218

219219
##### Email verification and password reset
220220

221-
Verifying user email addresses and enabling password reset via email requries an email adapter. As part of the `parse-server` package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
221+
Verifying user email addresses and enabling password reset via email requires an email adapter. As part of the `parse-server` package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
222222

223223
```js
224224
var server = ParseServer({
225225
...otherOptions,
226226
// Enable email verification
227227
verifyUserEmails: true,
228228

229+
// if `verifyUserEmails` is `true` and
230+
// if `emailVerifyTokenValidityDuration` is `undefined` then
231+
// email verify token never expires
232+
// else
233+
// email verify token expires after `emailVerifyTokenValidityDuration`
234+
//
235+
// `emailVerifyTokenValidityDuration` defaults to `undefined`
236+
//
237+
// email verify token below expires in 2 hours (= 2 * 60 * 60 == 7200 seconds)
238+
emailVerifyTokenValidityDuration: 2 * 60 * 60, // in seconds (2 hours = 7200 seconds)
239+
229240
// set preventLoginWithUnverifiedEmail to false to allow user to login without verifying their email
230241
// set preventLoginWithUnverifiedEmail to true to prevent user from login if their email is not verified
231242
preventLoginWithUnverifiedEmail: false, // defaults to false
@@ -256,6 +267,8 @@ You can also use other email adapters contributed by the community such as:
256267
- [parse-server-sendgrid-adapter](https://www.npmjs.com/package/parse-server-sendgrid-adapter)
257268
- [parse-server-mandrill-adapter](https://www.npmjs.com/package/parse-server-mandrill-adapter)
258269
- [parse-server-simple-ses-adapter](https://www.npmjs.com/package/parse-server-simple-ses-adapter)
270+
- [parse-server-mailgun-adapter-template](https://www.npmjs.com/package/parse-server-mailgun-adapter-template)
271+
- [parse-server-mailjet-adapter](https://www.npmjs.com/package/parse-server-mailjet-adapter)
259272

260273
### Using environment variables to configure Parse Server
261274

package.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "2.2.16",
3+
"version": "2.2.18",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -18,61 +18,58 @@
1818
],
1919
"license": "BSD-3-Clause",
2020
"dependencies": {
21-
"babel-polyfill": "6.8.0",
22-
"babel-runtime": "6.6.1",
23-
"bcrypt-nodejs": "0.0.3",
21+
"babel-polyfill": "6.13.0",
22+
"bcryptjs": "2.3.0",
2423
"body-parser": "1.15.2",
25-
"colors": "1.1.2",
2624
"commander": "2.9.0",
2725
"deepcopy": "0.6.3",
2826
"express": "4.14.0",
2927
"intersect": "1.0.1",
30-
"lodash": "4.12.0",
28+
"lodash": "4.15.0",
3129
"lru-cache": "4.0.1",
3230
"mailgun-js": "0.7.10",
3331
"mime": "1.3.4",
34-
"mongodb": "2.1.18",
35-
"multer": "1.1.0",
36-
"parse": "1.9.0",
37-
"parse-server-fs-adapter": "1.0.0",
38-
"parse-server-push-adapter": "1.0.4",
39-
"parse-server-s3-adapter": "1.0.3",
32+
"mongodb": "2.2.7",
33+
"multer": "1.2.0",
34+
"parse": "1.9.1",
35+
"parse-server-fs-adapter": "1.0.1",
36+
"parse-server-push-adapter": "1.1.0",
37+
"parse-server-s3-adapter": "1.0.5",
4038
"parse-server-simple-mailgun-adapter": "1.0.0",
41-
"pg-promise": "5.2.0",
39+
"pg-promise": "5.3.1",
4240
"redis": "2.6.2",
43-
"request": "2.73.0",
44-
"request-promise": "4.0.0",
45-
"semver": "^5.2.0",
41+
"request": "2.74.0",
42+
"semver": "5.2.0",
4643
"tv4": "1.2.7",
4744
"winston": "2.2.0",
48-
"winston-daily-rotate-file": "1.1.5",
45+
"winston-daily-rotate-file": "1.3.0",
4946
"ws": "1.1.1"
5047
},
5148
"devDependencies": {
52-
"babel-cli": "6.8.0",
53-
"babel-core": "6.10.4",
54-
"babel-istanbul": "0.11.0",
55-
"babel-plugin-syntax-flow": "6.8.0",
49+
"babel-cli": "6.11.4",
50+
"babel-core": "6.13.2",
51+
"babel-plugin-syntax-flow": "6.13.0",
5652
"babel-plugin-transform-flow-strip-types": "6.8.0",
57-
"babel-preset-es2015": "6.6.0",
53+
"babel-preset-es2015": "6.13.2",
5854
"babel-preset-stage-0": "6.5.0",
59-
"babel-register": "6.8.0",
60-
"codecov": "1.0.1",
55+
"babel-register": "6.11.6",
56+
"bcrypt-nodejs": "0.0.3",
6157
"cross-env": "2.0.0",
6258
"deep-diff": "0.3.4",
63-
"gaze": "1.1.0",
59+
"gaze": "1.1.1",
60+
"istanbul": "1.0.0-alpha.1",
6461
"jasmine": "2.4.1",
6562
"mongodb-runner": "3.3.2",
66-
"nodemon": "1.9.2"
63+
"nodemon": "1.10.0",
64+
"request-promise": "4.1.1"
6765
},
6866
"scripts": {
6967
"dev": "npm run build && node bin/dev",
70-
"build": "./node_modules/.bin/babel src/ -d lib/",
71-
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 ./node_modules/.bin/mongodb-runner start",
72-
"test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
73-
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/** ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
74-
"posttest": "./node_modules/.bin/mongodb-runner stop",
75-
"coverage": "cross-env COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' npm test",
68+
"build": "babel src/ -d lib/",
69+
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
70+
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 babel-node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
71+
"coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/istanbul cover' npm test",
72+
"coverage:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 babel-node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
7673
"start": "node ./bin/parse-server",
7774
"prepublish": "npm run build"
7875
},
@@ -81,5 +78,8 @@
8178
},
8279
"bin": {
8380
"parse-server": "./bin/parse-server"
81+
},
82+
"optionalDependencies": {
83+
"bcrypt": "0.8.7"
8484
}
8585
}

spec/AdapterLoader.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ describe("AdapterLoader", ()=>{
4545
done();
4646
});
4747

48+
it("should instantiate an adapter from npm module", (done) => {
49+
var adapter = loadAdapter({
50+
module: 'parse-server-fs-adapter'
51+
});
52+
53+
expect(typeof adapter).toBe('object');
54+
expect(typeof adapter.createFile).toBe('function');
55+
expect(typeof adapter.deleteFile).toBe('function');
56+
expect(typeof adapter.getFileData).toBe('function');
57+
expect(typeof adapter.getFileLocation).toBe('function');
58+
done();
59+
});
60+
4861
it("should instantiate an adapter from function/Class", (done) => {
4962
var adapter = loadAdapter({
5063
adapter: FilesAdapter

spec/Analytics.spec.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const analyticsAdapter = {
2+
appOpened: function(parameters, req) {},
3+
trackEvent: function(eventName, parameters, req) {}
4+
}
5+
6+
describe('AnalyticsController', () => {
7+
it('should track a simple event', (done) => {
8+
9+
spyOn(analyticsAdapter, 'trackEvent').and.callThrough();
10+
reconfigureServer({
11+
analyticsAdapter
12+
}).then(() => {
13+
return Parse.Analytics.track('MyEvent', {
14+
key: 'value',
15+
count: '0'
16+
})
17+
}).then(() => {
18+
expect(analyticsAdapter.trackEvent).toHaveBeenCalled();
19+
var lastCall = analyticsAdapter.trackEvent.calls.first();
20+
let args = lastCall.args;
21+
expect(args[0]).toEqual('MyEvent');
22+
expect(args[1]).toEqual({
23+
dimensions: {
24+
key: 'value',
25+
count: '0'
26+
}
27+
});
28+
done();
29+
}, (err) => {
30+
fail(JSON.stringify(err));
31+
done();
32+
})
33+
});
34+
35+
it('should track a app opened event', (done) => {
36+
37+
spyOn(analyticsAdapter, 'appOpened').and.callThrough();
38+
reconfigureServer({
39+
analyticsAdapter
40+
}).then(() => {
41+
return Parse.Analytics.track('AppOpened', {
42+
key: 'value',
43+
count: '0'
44+
})
45+
}).then(() => {
46+
expect(analyticsAdapter.appOpened).toHaveBeenCalled();
47+
var lastCall = analyticsAdapter.appOpened.calls.first();
48+
let args = lastCall.args;
49+
expect(args[0]).toEqual({
50+
dimensions: {
51+
key: 'value',
52+
count: '0'
53+
}
54+
});
55+
done();
56+
}, (err) => {
57+
fail(JSON.stringify(err));
58+
done();
59+
})
60+
})
61+
})

spec/Auth.spec.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,18 @@ describe('Auth', () => {
7777
auth.getUserRoles()
7878
.then((roles) => expect(roles).toEqual([]))
7979
.then(() => done());
80-
})
80+
});
81+
82+
it('should properly handle bcrypt upgrade', (done) => {
83+
var bcryptOriginal = require('bcrypt-nodejs');
84+
var bcryptNew = require('bcryptjs');
85+
bcryptOriginal.hash('my1Long:password', null, null, function(err, res) {
86+
bcryptNew.compare('my1Long:password', res, function(err, res) {
87+
expect(res).toBeTruthy();
88+
done();
89+
})
90+
});
91+
});
8192

8293
});
8394
});

0 commit comments

Comments
 (0)