mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-29 00:19:14 +08:00
Reflecion of #589
This commit is contained in:
@ -20,7 +20,7 @@ describe.skip('Customer classifier', () => {
|
|||||||
test('When customer spent more than 500$, should be classified as premium', () => {
|
test('When customer spent more than 500$, should be classified as premium', () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const customerToClassify = {spent:505, joined: new Date(), id:1}
|
const customerToClassify = {spent:505, joined: new Date(), id:1}
|
||||||
const DBStub = sinon.stub(dataAccess, "getCustomer")
|
const DBStub = sinon.stub(dataAccess, 'getCustomer')
|
||||||
.reply({id:1, classification: 'regular'});
|
.reply({id:1, classification: 'regular'});
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
@ -38,7 +38,7 @@ describe.skip('Customer classifier', () => {
|
|||||||
```javascript
|
```javascript
|
||||||
test('Should be classified as premium', () => {
|
test('Should be classified as premium', () => {
|
||||||
const customerToClassify = {spent:505, joined: new Date(), id:1}
|
const customerToClassify = {spent:505, joined: new Date(), id:1}
|
||||||
const DBStub = sinon.stub(dataAccess, "getCustomer")
|
const DBStub = sinon.stub(dataAccess, 'getCustomer')
|
||||||
.reply({id:1, classification: 'regular'});
|
.reply({id:1, classification: 'regular'});
|
||||||
const receivedClassification = customerClassifier.classifyCustomer(customerToClassify);
|
const receivedClassification = customerClassifier.classifyCustomer(customerToClassify);
|
||||||
expect(receivedClassification).toMatch('premium');
|
expect(receivedClassification).toMatch('premium');
|
||||||
|
|||||||
Reference in New Issue
Block a user