abda6e6338
closes #10773 - The refactoring is a substitute for `urlService.utils` used previously throughout the codebase and now extracted into the separate module in Ghost-SDK - Added url-utils stubbing utility for test suites - Some tests had to be refactored to avoid double mocks (when url's are being reset inside of rested 'describe' groups)
14 lines
397 B
JavaScript
14 lines
397 B
JavaScript
const UrlUtils = require('@tryghost/url-utils');
|
|
const config = require('../../config');
|
|
|
|
const urlUtils = new UrlUtils({
|
|
url: config.get('url'),
|
|
adminUrl: config.get('admin:url'),
|
|
apiVersions: config.get('api:versions'),
|
|
slugs: config.get('slugs').protected,
|
|
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
|
baseApiPath: '/ghost/api'
|
|
});
|
|
|
|
module.exports = urlUtils;
|