Skip to content

Commit

Permalink
Use template and just do the first 4 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman committed Aug 2, 2014
1 parent bf6e477 commit 782cdce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ test('extend config with iceServers', function(t) {

test('iceServer generator generates iceServers', function(t) {
var i = 0;
var config = {
var template = {
iceServerGenerator: function () {
i += 1;
return [{urls: 'turn:nowhere.com:' + i}];
}
};
var config = {};

t.plan(5);
t.ok(config = generators.config(config), 'generated config');
t.plan(4);
t.ok(config = generators.config(template), 'generated config');
t.deepEqual(config.iceServers, [{urls: 'turn:nowhere.com:1'}], 'first generation succeeded');
t.ok(config = generators.config(config), 'generated new config');
t.ok(config = generators.config(template), 'generated new config');
t.deepEqual(config.iceServers, [{urls: 'turn:nowhere.com:2'}], 'second generation succeeded');
t.equal(config.iceServerGenerator, undefined, 'it removed the generator function');
});

0 comments on commit 782cdce

Please sign in to comment.