You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this project at a KDE Neon(Ubuntu based) and even with the files with the expected answer, the tests aren't working.
`# Separation of Concerns 3 (Exercise 4 of 8)
✓ should not have a function called increaseBalance()
✓ should not have a function called getBalance()
✓ should not have a function called canAfford()
✓ should not have a function called decreaseBalance()
✓ should not have a function called getAmount()
✓ should not have a function called insertCoin()
✓ should not have a function called releaseChange()
should have a function called getProducts()
should have a function called getProduct()
✓ should not have a function called isValidAmount()
8 passing (10ms)
2 failing
should have a function called getProducts():
AssertionError: expected 'undefined' to equal 'function'
expected - actual
-undefined
+function
at Context. (/usr/local/lib/node_modules/js-best-practices/exercises/decompose_productinventory/exercise.js:39:53)
should have a function called getProduct():
AssertionError: expected 'undefined' to equal 'function'
expected - actual
-undefined
+function
at Context. (/usr/local/lib/node_modules/js-best-practices/exercises/decompose_productinventory/exercise.js:43:52)
`
I'm using this project at a KDE Neon(Ubuntu based) and even with the files with the expected answer, the tests aren't working.
`# Separation of Concerns 3 (Exercise 4 of 8)
✓ should not have a function called increaseBalance()
✓ should not have a function called getBalance()
✓ should not have a function called canAfford()
✓ should not have a function called decreaseBalance()
✓ should not have a function called getAmount()
✓ should not have a function called insertCoin()
✓ should not have a function called releaseChange()
✓ should not have a function called isValidAmount()
8 passing (10ms)
2 failing
should have a function called getProducts():
AssertionError: expected 'undefined' to equal 'function'
-undefined
+function
at Context. (/usr/local/lib/node_modules/js-best-practices/exercises/decompose_productinventory/exercise.js:39:53)
should have a function called getProduct():
AssertionError: expected 'undefined' to equal 'function'
-undefined
+function
at Context. (/usr/local/lib/node_modules/js-best-practices/exercises/decompose_productinventory/exercise.js:43:52)
`
And productInventory.js
`var products = [
{
name: 'Skittles',
price: 85,
id: 'A1'
}
];
module.exports = {
getProducts: function() {
return products;
},
getProduct: function(productId) {
var product = products.find(function(p) { return p.id === productId; });
return product;
}
};`
So I think that should work. I had similar issues at Exercise 1 and 2.
The text was updated successfully, but these errors were encountered: