storage-upload/test/helper.server.mjs

39 lines
664 B
JavaScript
Raw Normal View History

import { stub } from 'eltro'
import Client from './helper.client.mjs'
import defaults from '../api/defaults.mjs'
import serv from '../api/server.mjs'
serv.log = {
log: stub(),
warn: stub(),
info: stub(),
error: stub(),
}
export const server = serv
2017-12-09 21:51:18 +00:00
export function createClient() {
return new Client()
}
2017-12-10 09:45:38 +00:00
export function resetLog() {
serv.log.log.reset()
serv.log.info.reset()
serv.log.warn.reset()
serv.log.error.reset()
}
2017-12-10 09:45:38 +00:00
export function createContext(opts) {
return defaults(opts, {
query: new Map(),
2017-12-10 09:45:38 +00:00
req: { },
res: { },
log: {
log: stub(),
warn: stub(),
info: stub(),
error: stub(),
},
2017-12-10 09:45:38 +00:00
})
}