We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
airSpeedVelocity
AffricanSwallowDelegate
1 parent a4d9600 commit 81bfbaaCopy full SHA for 81bfbaa
src/example-02/birds/affrican-swallow/delegate/index.js
@@ -2,4 +2,8 @@ export class AffricanSwallowDelegate {
2
constructor(data) {
3
this._numberOfCoconuts = data.numberOfCoconuts;
4
}
5
+
6
+ get airSpeedVelocity() {
7
+ return 40 - 2 * this._numberOfCoconuts;
8
+ }
9
src/example-02/birds/affrican-swallow/delegate/index.test.js
@@ -0,0 +1,10 @@
1
+import { AffricanSwallowDelegate } from '.';
+describe('AffricanSwallowDelegate', () => {
+ describe('airSpeedVelocity', () => {
+ it('should have airSpeedVelocity 38 if number of coconuts is 1', () => {
+ const bird = new AffricanSwallowDelegate({ type: 'AffricanSwallow', numberOfCoconuts: 1 });
+ expect(bird.airSpeedVelocity).toBe(38);
+ });
10
+});
0 commit comments