Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests is not working #22

Open
lays147 opened this issue Mar 3, 2017 · 0 comments
Open

Tests is not working #22

lays147 opened this issue Mar 3, 2017 · 0 comments

Comments

@lays147
Copy link

lays147 commented Mar 3, 2017

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()

  1. should have a function called getProducts()
  2. should have a function called getProduct()
    ✓ should not have a function called isValidAmount()

8 passing (10ms)
2 failing

  1. 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)

  2. 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)
    `

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants