Skip to content

Commit

Permalink
Add a very basic test for Network#export
Browse files Browse the repository at this point in the history
  • Loading branch information
astorije committed Mar 16, 2016
1 parent 9ef348e commit f35b0df
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/models/network.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";

var expect = require("chai").expect;

var Chan = require("../../src/models/chan");
var Network = require("../../src/models/network");

describe("Network", function() {
describe("#export()", function() {

it("should produce an valid object", function() {
var network = new Network({name: "networkName"});
network.channels.push(new Chan({name: "#thelounge"}));
network.channels.push(new Chan({name: "&foobar"}));

expect(network.export()).to.deep.equal({
name: "networkName",
host: "",
port: 6667,
tls: false,
password: "",
username: "",
realname: "",
commands: [],
nick: undefined,
join: "#thelounge,&foobar",
});
});
});
});

0 comments on commit f35b0df

Please sign in to comment.