Skip to content

Commit

Permalink
💫 added Server tests #7 #6
Browse files Browse the repository at this point in the history
  • Loading branch information
8eecf0d2 committed Oct 16, 2018
1 parent 581660f commit 4389aed
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/ts/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as mocha from "mocha";
import * as assert from "assert";

import { parseNetlifyConfig, Server } from "../../src/ts";

process.env.SILENT = "true";

mocha.describe('Server', () => {
mocha.describe('lifecycle', () => {
mocha.it('should listen and close correctly', async () => {
const netlifyConfig = parseNetlifyConfig("test/assets/netlify.toml");

const server = new Server(netlifyConfig, 9000);
await server.listen();

//@ts-ignore
assert.notEqual(server.server.address(), null);

server.close();

//@ts-ignore
assert.equal(server.server.address(), null);
});
});
});

0 comments on commit 4389aed

Please sign in to comment.