10000 unit tests · wolfwithcode/design-patterns-JS@8822cd0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8822cd0

Browse files
committed
unit tests
make tests more legible.
1 parent d14e01a commit 8822cd0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/factory_es6-test.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
const expect = require('chai').expect;
22
import BmwFactory from '../src/creational/factory/factory_es6';
33 A24C

4-
describe('factory es6 test', () => {
5-
it('sanity', () => {
6-
const bmwFactory = new BmwFactory();
4+
describe('Factory es6 test', () => {
5+
it('We can create a X5 instance', () => {
76
const x5 = BmwFactory.create('X5');
8-
const x6 = BmwFactory.create('X6');
7+
expect(x5.model).to.equal('X5');
8+
});
99

10+
it('The X5 price is properly set', () => {
11+
const x5 = BmwFactory.create('X5');
1012
expect(x5.price).to.equal(108000);
11-
expect(x6.price).to.equal(111000);
12-
expect(x5.maxSpeed).to.equal(300);
13-
expect(x6.maxSpeed).to.equal(320);
1413
});
1514
});

0 commit comments

Comments
 (0)
0