Created
August 10, 2018 09:38
-
-
Save MonsieurMan/a700a9fcddc3ca98c389b94463f2747f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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