Skip to content

Commit

Permalink
[nodejs] Add test case for freameset
Browse files Browse the repository at this point in the history
Impacted tests(approved): new 1, update 0, delete 0
Unit test platform: Ubuntu 16.04
Unit test result summary: pass 1, fail 0, block 0
  • Loading branch information
zhaoming0 committed Apr 17, 2018
1 parent 19006f8 commit de2abc4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion wrappers/nodejs/test/test-frameset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Intel Corporation. All rights reserved.
// Copyright (c) 2018 Intel Corporation. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license
// that can be found in the LICENSE file.

Expand Down Expand Up @@ -117,4 +117,14 @@ describe('FrameSet test', function() {
let D = frameset.getFrame(rs2.stream['STREAM_COLOR']); // jshint ignore:line
assert(D instanceof rs2.VideoFrame);
});

it('Testing method forEach', () => {
let counter = 0;
function callback(frame) {
counter++;
assert.equal(frame instanceof rs2.Frame, true);
}
frameset.forEach(callback);
assert.equal(counter, frameset.size);
});
});

0 comments on commit de2abc4

Please sign in to comment.