Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
minamorl committed Jul 7, 2016
1 parent 64a3bac commit fcc36fd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/test_auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// fake process.env
process.env.FRONTEND_URL = "dummy"
process.env.SESSION_SECRET = "dummy"
process.env.TWITTER_CONSUMER_KEY = "dummy"
process.env.TWITTER_CONSUMER_SECRET = "dummy"
process.env.TWITTER_CALLBACK_URL = "dummy"

import * as request from "supertest"
import {app} from "../server/app"
import "../server/auth"

describe("auth", () => {
// Due to dummy environment variables, it raises internal error.
describe("/auth/twitter", () => {
it("exists", done => {
request(app)
.get("/auth/twitter")
.expect(500, done)
})
})
describe("/auth/twitter/callback", () => {
it("exists", done => {
request(app)
.get("/auth/twitter/callback")
.expect(500, done)
})
})
describe("/logout", () => {
it("exists", done => {
request(app)
.get("/auth/twitter/callback")
.expect(500, done)
})
})
})

0 comments on commit fcc36fd

Please sign in to comment.