Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
joaojunceira-zendesk committed May 27, 2024
1 parent f2bc0b4 commit e248f77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Configurator.prototype._forPersistence = function (configuration) {
// Private methods
// TODO: Move to Util module, or somewhere else

export function parseUrl (redisUrl) {
function parseUrl (redisUrl) {
const parsedUrl = require('url').parse(redisUrl)
const config = {
host: parsedUrl.hostname,
Expand Down Expand Up @@ -236,4 +236,4 @@ function clone (object) {
return JSON.parse(JSON.stringify(object))
}

module.exports = Configurator
module.exports = { Configurator, parseUrl }
4 changes: 2 additions & 2 deletions test/configurator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const assert = require('assert')
const noArgs = ['', '']
const noEnv = {}
const Configurator = require('../configurator')
const { Configurator, parseUrl } = require('../configurator')

// Helper function. It tests multiple features of a given configuration option.
function describeOptionTest (configurator, name, options) {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('the Configurator', function () {
const config = Configurator.load({
config: {
port: 8004,
redisReplicaUrl: Configurator.parseUrl('redis://localhost:6379')
redisReplicaUrl: parseUrl('redis://localhost:6379')
},
env: {
RADAR_SENTINEL_MASTER_NAME: 'mymaster',
Expand Down

0 comments on commit e248f77

Please sign in to comment.