Skip to content

Commit c3bb43c

Browse files
committed
test(sankey): collect all Lib.warn arguments in the spy
Lib.warn is variadic; pushing only the first argument made warnings[0][0] a single character instead of the message prefix.
1 parent ef3eef8 commit c3bb43c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/jasmine/tests/sankey_test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ describe('sankey tests', function() {
127127

128128
it('warns when the figure is too small for node.pad', function(done) {
129129
var warnings = [];
130-
spyOn(Lib, 'warn').and.callFake(function(msg) {
131-
warnings.push(msg);
130+
spyOn(Lib, 'warn').and.callFake(function() {
131+
// collect all arguments, as Lib.warn is variadic
132+
warnings.push(Array.prototype.slice.call(arguments));
132133
});
133134

134135
var fig = Lib.extendDeep({}, padMock);

0 commit comments

Comments
 (0)