t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
365 stars 104 forks source link

Is this still working? #29

Closed thevinci closed 8 years ago

thevinci commented 8 years ago

I ran a mocha test and everything seems to break.

When I plugged in my credentials from Amazon, I don't get an error but I get results = undefined.

node v0.12.4 amazon-product-api v0.3.4

thevinci commented 8 years ago

This is what I get from mocha

formatQueryParams(query, method, credentials) ✓ should return an object ItemSearch ✓ should use default values ItemLookup ✓ should use default values BrowseNodeLookup ✓ should use default values

generateQueryString(query, method, credentials) 1) should return a string

createClient(credentials) ✓ should return amazon product api client with item search method

client.itemSearch(query, cb) when credentials are valid when no callback is passed 2) should return search results from amazon 3) should work with custom domain when callback is passed 4) should return search results from amazon when credentials are invalid when no callback is passed ✓ should return an error (172ms) when callback is passed ✓ should return an error (137ms)

7 passing (482ms) 4 failing

1) generateQueryString(query, method, credentials) should return a string: TypeError: Not a buffer at TypeError (native) at new Hmac (crypto.js:136:16) at Object.Hmac (crypto.js:134:12) at generateSignature (lib/utils.js:4:21) at generateQueryString (lib/utils.js:106:38) at Context. (test/test.coffee:57:21)

2) client.itemSearch(query, cb) when credentials are valid when no callback is passed should return search results from amazon: TypeError: Not a buffer at TypeError (native) at new Hmac (crypto.js:136:16) at Object.Hmac (crypto.js:134:12) at generateSignature (lib/utils.js:4:21) at generateQueryString (lib/utils.js:106:38) at Object.itemSearch (lib/index.js:9:15) at Context. (test/test.coffee:100:16)

3) client.itemSearch(query, cb) when credentials are valid when no callback is passed should work with custom domain: TypeError: Not a buffer at TypeError (native) at new Hmac (crypto.js:136:16) at Object.Hmac (crypto.js:134:12) at generateSignature (lib/utils.js:4:21) at generateQueryString (lib/utils.js:106:38) at Object.itemSearch (lib/index.js:9:15) at Context. (test/test.coffee:108:16)

4) client.itemSearch(query, cb) when credentials are valid when callback is passed should return search results from amazon: TypeError: Not a buffer at TypeError (native) at new Hmac (crypto.js:136:16) at Object.Hmac (crypto.js:134:12) at generateSignature (lib/utils.js:4:21) at generateQueryString (lib/utils.js:106:38) at Object.itemSearch (lib/index.js:9:15) at Context. (test/test.coffee:118:16)

masterT commented 8 years ago

Hi,

You just need to pass a valid Amazon Credentials in the process like this AWS_TAG=[your tag value] AWS_ID=[your id value] AWS_SECRET=[your secret value] npm test

EDITED: Set your credentials first

test/test.coffee line 7

credentials =  
  awsTag: process.env.AWS_TAG
  awsId: process.env.AWS_ID
  awsSecret: process.env.AWS_SECRET