Skip to content

Instantly share code, notes, and snippets.

@shlomokraus
Created January 20, 2019 20:26
Show Gist options
  • Save shlomokraus/d4a1213aaf7cd53b2a9ed1f23aec2f3f to your computer and use it in GitHub Desktop.
Save shlomokraus/d4a1213aaf7cd53b2a9ed1f23aec2f3f to your computer and use it in GitHub Desktop.
Implementation of MessageService to deomnstrate Mockshot
import { UserService } from "./UserService";
export class MessageService {
constructor(private readonly userService: UserService){}
async prepareMessage(text: string, userId: string) {
const user = await this.userService.getUser(userId);
return {
to: user.email,
title: `Hello ${user.name}`,
body: text
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment