Ocelot-Social/src/jest/helpers.js
Robert Schäfer 1734554a88 Fix seeds without the use of neode
@appinteractive ping
2019-02-18 15:35:45 +01:00

17 lines
436 B
JavaScript

import { request } from 'graphql-request'
export const testServerHost = 'http://127.0.0.1:4123'
export async function authenticatedHeaders ({ email, password }, host = testServerHost) {
const mutation = `
mutation {
login(email:"${email}", password:"${password}"){
token
}
}`
const response = await request(host, mutation)
return {
authorization: `Bearer ${response.login.token}`
}
}