8000 pr fix · wolfwithcode/design-patterns-JS@b5b0e3e · GitHub
[go: up one dir, main page]

Skip to content

Commit b5b0e3e

Browse files
committed
pr fix
1 parent 30f04fe commit b5b0e3e

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/behavioral/chain-of-resp/chain-of-resp-es6.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ class PriceDiscount{
4848

4949
exec(products) {
5050
let result = 0;
51-
let total = products.reduce((a, b)=> {
52-
return a + b;
53-
});
51+
let total = products.reduce((a, b)=> a + b);
5452

5553
if (total >= 500)
5654
result = 0.1;
@@ -65,4 +63,4 @@ class NoneDiscount {
6563
};
6664
}
6765

68-
module.exports = [ShoppingCart, Discount];
66+
export { ShoppingCart , Discount };

test/chain-of-resp-es6-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const expect = require('chai').expect;
22

3-
const [ShoppingCart, Discount] = require('../src/behavioral/chain-of-resp/chain-of-resp-es6');
3+
import {ShoppingCart, Discount} from '../src/behavioral/chain-of-resp/chain-of-resp-es6';
44

55
describe('chain of resp es6 tests', () => {
66

@@ -15,7 +15,7 @@ describe('chain of resp es6 tests', () => {
1515
expect(resp).to.equal(0.1);
1616
});
1717

18-
it('mote than 3 products', () => {
18+
it('more than 3 products', () => {
1919
const discount = new Discount();
2020

2121
const sc = new ShoppingCart();
@@ -29,7 +29,7 @@ describe('chain of resp es6 tests', () => {
2929
expect(resp).to.equal(0.05);
3030
});
3131

32-
it('mote than 3 products and > $ 500 ', () => {
32+
it('more than 3 products and > $ 500 ', () => {
3333
let discount = new Discount();
3434

3535
let sc = new ShoppingCart();

test/chain-of-resp-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('chain of resp tests', () => {
1515
expect(resp).to.equal(0.1);
1616
});
1717

18-
it('mote than 3 products', () => {
18+
it('more than 3 products', () => {
1919
var discount = new Discount();
2020

2121
var sc = new ShoppingCart();
@@ -29,7 +29,7 @@ describe('chain of resp tests', () => {
2929
expect(resp).to.equal(0.05);
3030
});
3131

32-
it('mote than 3 products and > $ 500 ', () => {
32+
it('more than 3 products and > $ 500 ', () => {
3333
var discount = new Discount();
3434

3535
var sc = new ShoppingCart();

0 commit comments

Comments
 (0)
0