Skip to content

Instantly share code, notes, and snippets.

@dpashkevich
Last active January 4, 2019 04:46
Show Gist options
  • Save dpashkevich/1a9ddf6427a8d363cdff58dc2b4e5a59 to your computer and use it in GitHub Desktop.
Save dpashkevich/1a9ddf6427a8d363cdff58dc2b4e5a59 to your computer and use it in GitHub Desktop.
interface Person {
firstName: string;
lastName: string;
}
function greeter(person: Person): string {
return "Hello, " + person.firstName + " " + person.lastName;
}
// Jasmine spec:
describe("greeter", function() {
it("returns greeting", function() {
expect(
greeter({firstName: 'James', lastName: 'Hetfield'})
).toEqual('Hello, James Hetfield');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment