10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d14e01a commit 8822cd0Copy full SHA for 8822cd0
test/factory_es6-test.js
@@ -1,15 +1,14 @@
1
const expect = require('chai').expect;
2
import BmwFactory from '../src/creational/factory/factory_es6';
3
4
-describe('factory es6 test', () => {
5
- it('sanity', () => {
6
- const bmwFactory = new BmwFactory();
+describe('Factory es6 test', () => {
+ it('We can create a X5 instance', () => {
7
const x5 = BmwFactory.create('X5');
8
- const x6 = BmwFactory.create('X6');
+ expect(x5.model).to.equal('X5');
+ });
9
10
+ it('The X5 price is properly set', () => {
11
+ const x5 = BmwFactory.create('X5');
12
expect(x5.price).to.equal(108000);
- expect(x6.price).to.equal(111000);
- expect(x5.maxSpeed).to.equal(300);
13
- expect(x6.maxSpeed).to.equal(320);
14
});
15
0 commit comments