Created
November 28, 2016 21:27
-
-
Save kkemple/c85bbb139b2b731853dba5893fae2cce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test from 'ava' | |
import Joi from 'joi' | |
import server from './server' | |
import { userCreationPayload } from './validations' | |
/* ... set up tests ... */ | |
test('[GET] /users/:id', async t => { | |
try { | |
const response = await server.inject('users/1') | |
} catch (error) { | |
t.fail(error) | |
} | |
const result = Joi.validate(response.result, userCreationPayload) | |
if (result.error) t.fail(result.error) | |
else t.pass('received expected response for get request') | |
t.end() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment