33 lines
2.4 KiB
JavaScript
33 lines
2.4 KiB
JavaScript
"use strict";
|
|
require("typings-test");
|
|
require("should");
|
|
const smartsocket = require("../dist/index");
|
|
let testSmartsocket;
|
|
let testSmartsocketClient;
|
|
let testConfig = {
|
|
port: 3000
|
|
};
|
|
describe("smartsocket", function () {
|
|
it("should create a new smartsocket", function () {
|
|
testSmartsocket = new smartsocket.Smartsocket({ port: testConfig.port });
|
|
testSmartsocket.should.be.instanceOf(smartsocket.Smartsocket);
|
|
});
|
|
it("should register a new Function", function () {
|
|
});
|
|
it("should start listening when .started is called", function () {
|
|
testSmartsocket.startServer();
|
|
});
|
|
it("should react to a new websocket connection", function (done) {
|
|
this.timeout(10000);
|
|
testSmartsocketClient = new smartsocket.SmartsocketClient({
|
|
port: testConfig.port,
|
|
url: "http://localhost",
|
|
password: "testPassword",
|
|
alias: "testClient1"
|
|
});
|
|
});
|
|
it("should close the server", function () {
|
|
testSmartsocket.closeServer();
|
|
});
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUVoQixNQUFPLFdBQVcsV0FBVyxlQUFlLENBQUMsQ0FBQztBQUU5QyxJQUFJLGVBQXdDLENBQUM7QUFDN0MsSUFBSSxxQkFBb0QsQ0FBQztBQUV6RCxJQUFJLFVBQVUsR0FBRztJQUNiLElBQUksRUFBQyxJQUFJO0NBQ1osQ0FBQTtBQUVELFFBQVEsQ0FBQyxhQUFhLEVBQUU7SUFDcEIsRUFBRSxDQUFDLGlDQUFpQyxFQUFFO1FBQ2xDLGVBQWUsR0FBRyxJQUFJLFdBQVcsQ0FBQyxXQUFXLENBQUMsRUFBRSxJQUFJL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