taskcluster-client
Advanced tools
Comparing version
@@ -137,2 +137,5 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
var value = routingKeyPattern[key.name]; | ||
if (typeof(value) === 'number') { | ||
return '' + value; | ||
} | ||
if (typeof(value) === 'string') { | ||
@@ -143,8 +146,7 @@ assert(key.multipleWords || value.indexOf('.') === -1, | ||
return value; | ||
} else { | ||
assert(value === null || value === undefined, | ||
"Value: '" + value + "' is not supported as routingKey "+ | ||
"pattern for " + key.name); | ||
return key.multipleWords ? '#' : '*'; | ||
} | ||
assert(value === null || value === undefined, | ||
"Value: '" + value + "' is not supported as routingKey "+ | ||
"pattern for " + key.name); | ||
return key.multipleWords ? '#' : '*'; | ||
}).join('.'); | ||
@@ -151,0 +153,0 @@ } |
{ | ||
"name": "taskcluster-client", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"author": "Jonas Finnemann Jensen <jopsen@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Client for interfacing taskcluster components", |
@@ -32,2 +32,9 @@ suite('listener', function() { | ||
// Test that binding info is generated with number as routing keys | ||
test('binding info with number', function() { | ||
var info = mockEventsClient.testExchange({testId: 0}); | ||
assert(info.exchange = 'taskcluster-client/test/test-exchange'); | ||
assert(info.routingKeyPattern = '0.#.*.*'); | ||
}); | ||
// Bind and listen with listener | ||
@@ -34,0 +41,0 @@ test('bind and listen', function() { |
111762
0.32%1983
0.41%