Use single quotes :P
This commit is contained in:
@ -1,46 +1,46 @@
|
||||
const request = require("supertest");
|
||||
const request = require('supertest');
|
||||
|
||||
const createServer = require("../createServer");
|
||||
const withRevokedToken = require("./utils/withRevokedToken");
|
||||
const withToken = require("./utils/withToken");
|
||||
const createServer = require('../createServer');
|
||||
const withRevokedToken = require('./utils/withRevokedToken');
|
||||
const withToken = require('./utils/withToken');
|
||||
|
||||
describe("The /_auth endpoint", () => {
|
||||
describe('The /_auth endpoint', () => {
|
||||
let server;
|
||||
beforeEach(() => {
|
||||
server = createServer();
|
||||
});
|
||||
|
||||
describe("POST /_auth", () => {
|
||||
it("creates a new auth token", done => {
|
||||
describe('POST /_auth', () => {
|
||||
it('creates a new auth token', done => {
|
||||
request(server)
|
||||
.post("/_auth")
|
||||
.post('/_auth')
|
||||
.end((err, res) => {
|
||||
expect(res.body).toHaveProperty("token");
|
||||
expect(res.body).toHaveProperty('token');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GET /_auth", () => {
|
||||
describe("with no auth", () => {
|
||||
it("echoes back null", done => {
|
||||
describe('GET /_auth', () => {
|
||||
describe('with no auth', () => {
|
||||
it('echoes back null', done => {
|
||||
request(server)
|
||||
.get("/_auth")
|
||||
.get('/_auth')
|
||||
.end((err, res) => {
|
||||
expect(res.body).toHaveProperty("auth");
|
||||
expect(res.body).toHaveProperty('auth');
|
||||
expect(res.body.auth).toBe(null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("with a revoked auth token", () => {
|
||||
it("echoes back null", done => {
|
||||
describe('with a revoked auth token', () => {
|
||||
it('echoes back null', done => {
|
||||
withRevokedToken({ some: { scope: true } }, token => {
|
||||
request(server)
|
||||
.get("/_auth?token=" + token)
|
||||
.get('/_auth?token=' + token)
|
||||
.end((err, res) => {
|
||||
expect(res.body).toHaveProperty("auth");
|
||||
expect(res.body).toHaveProperty('auth');
|
||||
expect(res.body.auth).toBe(null);
|
||||
done();
|
||||
});
|
||||
@ -48,14 +48,14 @@ describe("The /_auth endpoint", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("with a valid auth token", () => {
|
||||
it("echoes back the auth payload", done => {
|
||||
describe('with a valid auth token', () => {
|
||||
it('echoes back the auth payload', done => {
|
||||
withToken({ some: { scope: true } }, token => {
|
||||
request(server)
|
||||
.get("/_auth?token=" + token)
|
||||
.get('/_auth?token=' + token)
|
||||
.end((err, res) => {
|
||||
expect(res.body).toHaveProperty("auth");
|
||||
expect(typeof res.body.auth).toBe("object");
|
||||
expect(res.body).toHaveProperty('auth');
|
||||
expect(typeof res.body.auth).toBe('object');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user