Skip to content

Instantly share code, notes, and snippets.

@MonsieurMan
Created August 10, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MonsieurMan/a700a9fcddc3ca98c389b94463f2747f to your computer and use it in GitHub Desktop.
Save MonsieurMan/a700a9fcddc3ca98c389b94463f2747f to your computer and use it in GitHub Desktop.
describe('adder', () => {
it('should build', () => {
expect(new Adder()).toBeTruthy();
});
it('adds up the two values', () => {
const adder = new Adder();
adder.a = 1;
adder.b = 1;
expect(adder.value).toEqual(2);
});
});
export class Adder {
@Prop() a: number;
@Prop() b: number;
@Method() get value(): number {
return this.a + this.b;
}
render(): JSX.Element {
return this.value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment