chore(package): update jasmine to version 3.0.0 (#4553)
* chore(package): update jasmine to version 3.0.0 Closes #4547 * Fixes failing tests for jasmine 3.0 Starting 3.0, done(something) will fail * Update tests so they dont leverage var, but let and const With jasmine 3.0, the randomization engine was making the test fails because of the scope of `var` * Remove randomizer * Use same adapter for PG tests, drop table to ensure the tests dont side effect
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var RedisCacheAdapter = require('../src/Adapters/Cache/RedisCacheAdapter').default;
|
||||
const RedisCacheAdapter = require('../src/Adapters/Cache/RedisCacheAdapter').default;
|
||||
/*
|
||||
To run this test part of the complete suite
|
||||
set PARSE_SERVER_TEST_CACHE='redis'
|
||||
@@ -7,8 +7,8 @@ and make sure a redis server is available on the default port
|
||||
describe_only(() => {
|
||||
return process.env.PARSE_SERVER_TEST_CACHE === 'redis';
|
||||
})('RedisCacheAdapter', function() {
|
||||
var KEY = 'hello';
|
||||
var VALUE = 'world';
|
||||
const KEY = 'hello';
|
||||
const VALUE = 'world';
|
||||
|
||||
function wait(sleep) {
|
||||
return new Promise(function(resolve) {
|
||||
@@ -17,7 +17,7 @@ describe_only(() => {
|
||||
}
|
||||
|
||||
it('should get/set/clear', (done) => {
|
||||
var cache = new RedisCacheAdapter({
|
||||
const cache = new RedisCacheAdapter({
|
||||
ttl: NaN
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ describe_only(() => {
|
||||
});
|
||||
|
||||
it('should expire after ttl', (done) => {
|
||||
var cache = new RedisCacheAdapter(null, 1);
|
||||
const cache = new RedisCacheAdapter(null, 1);
|
||||
|
||||
cache.put(KEY, VALUE)
|
||||
.then(() => cache.get(KEY))
|
||||
@@ -43,7 +43,7 @@ describe_only(() => {
|
||||
});
|
||||
|
||||
it('should find un-expired records', (done) => {
|
||||
var cache = new RedisCacheAdapter(null, 5);
|
||||
const cache = new RedisCacheAdapter(null, 5);
|
||||
|
||||
cache.put(KEY, VALUE)
|
||||
.then(() => cache.get(KEY))
|
||||
|
||||
Reference in New Issue
Block a user