* 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
45 lines
1.7 KiB
JavaScript
45 lines
1.7 KiB
JavaScript
const batch = require('../src/batch');
|
|
|
|
const originalURL = '/parse/batch';
|
|
const serverURL = 'http://localhost:1234/parse';
|
|
const serverURL1 = 'http://localhost:1234/1';
|
|
const serverURLNaked = 'http://localhost:1234/';
|
|
const publicServerURL = 'http://domain.com/parse';
|
|
const publicServerURLNaked = 'http://domain.com/';
|
|
|
|
describe('batch', () => {
|
|
it('should return the proper url', () => {
|
|
const internalURL = batch.makeBatchRoutingPathFunction(originalURL)('/parse/classes/Object');
|
|
|
|
expect(internalURL).toEqual('/classes/Object');
|
|
});
|
|
|
|
it('should return the proper url same public/local endpoint', () => {
|
|
const originalURL = '/parse/batch';
|
|
const internalURL = batch.makeBatchRoutingPathFunction(originalURL, serverURL, publicServerURL)('/parse/classes/Object');
|
|
|
|
expect(internalURL).toEqual('/classes/Object');
|
|
});
|
|
|
|
it('should return the proper url with different public/local mount', () => {
|
|
const originalURL = '/parse/batch';
|
|
const internalURL = batch.makeBatchRoutingPathFunction(originalURL, serverURL1, publicServerURL)('/parse/classes/Object');
|
|
|
|
expect(internalURL).toEqual('/classes/Object');
|
|
});
|
|
|
|
it('should return the proper url with naked public', () => {
|
|
const originalURL = '/batch';
|
|
const internalURL = batch.makeBatchRoutingPathFunction(originalURL, serverURL, publicServerURLNaked)('/classes/Object');
|
|
|
|
expect(internalURL).toEqual('/classes/Object');
|
|
});
|
|
|
|
it('should return the proper url with naked local', () => {
|
|
const originalURL = '/parse/batch';
|
|
const internalURL = batch.makeBatchRoutingPathFunction(originalURL, serverURLNaked, publicServerURL)('/parse/classes/Object');
|
|
|
|
expect(internalURL).toEqual('/classes/Object');
|
|
});
|
|
});
|