Skip to content

Commit

Permalink
Adding a CORS test
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Feb 20, 2017
1 parent bf99406 commit 46351cb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/behavior_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,24 @@ describe("Route parameters", function () {
.end();
});
});

describe("CORS", function () {
const port = 8013;

this.timeout(timeout);
tenso({port: port, routes: routes, logging: {level: "error"}, security: {csrf: false}});

it("OPTIONS /empty - returns an empty array", function () {
return tinyhttptest({url: "http://localhost:" + port + "/empty", method: "options"})
.cors()
.expectStatus(200)
.end();
});

it("GET /empty - returns an empty array", function () {
return tinyhttptest({url: "http://localhost:" + port + "/empty"})
.cors()
.expectStatus(200)
.end();
});
});

0 comments on commit 46351cb

Please sign in to comment.