mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 19:17:13 +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', () => {
|
||||
//Arrange
|
||||
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'});
|
||||
|
||||
//Act
|
||||
@ -38,7 +38,7 @@ describe.skip('Customer classifier', () => {
|
||||
```javascript
|
||||
test('Should be classified as premium', () => {
|
||||
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'});
|
||||
const receivedClassification = customerClassifier.classifyCustomer(customerToClassify);
|
||||
expect(receivedClassification).toMatch('premium');
|
||||
|
||||
Reference in New Issue
Block a user