Skip to content

Commit a0cf2ae

Browse files
committed
ex-02: remove EuropeanSwallow from createBird factory
1 parent 8fc679d commit a0cf2ae

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/example-02/birds/_factory/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { Bird } from '../index.js';
22
import { AffricanSwallow } from '../affrican-swallow/index.js';
3-
import { EuropeanSwallow } from '../european-swallow/index.js';
43
import { NorwegianBlueParrot } from '../norwegian-blue-parrot/index.js';
54

65
export function createBird(data) {
76
switch (data.type) {
8-
case 'EuropeanSwallow':
9-
return new EuropeanSwallow(data);
107
case 'AffricanSwallow':
118
return new AffricanSwallow(data);
129
case 'NorwegianBlueParrot':

src/example-02/birds/_factory/index.test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import { createBird } from './index';
22
import { Bird } from '..';
3-
import { EuropeanSwallow } from '../european-swallow';
43
import { AffricanSwallow } from '../affrican-swallow';
54
import { NorwegianBlueParrot } from '../norwegian-blue-parrot';
65

76
describe('createBird', () => {
8-
it('should create an EuropeanSwallow', () => {
9-
const bird = createBird({ type: 'EuropeanSwallow' });
10-
expect(bird).toBeInstanceOf(EuropeanSwallow);
11-
});
12-
137
it('should create an AffricanSwallow', () => {
148
const bird = createBird({ type: 'AffricanSwallow' });
159
expect(bird).toBeInstanceOf(AffricanSwallow);

0 commit comments

Comments
 (0)