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 fail #7

Open
ekkis opened this issue May 1, 2022 · 1 comment
Open

Tests fail #7

ekkis opened this issue May 1, 2022 · 1 comment

Comments

@ekkis
Copy link
Collaborator

ekkis commented May 1, 2022

out of the box I cannot run any of the tests successfully. here's a sample:

$ npm run test:sandbox
> [email protected] pretest:sandbox
> eslint --ext=.js .


> [email protected] test:sandbox
> cross-env NODE_ENV=sandbox tape ./tests/*.js

WARNING: NODE_ENV value of 'sandbox' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
TAP version 13
# CC - Create and Cancel
not ok 1 no error
  ---
    operator: notOk
    expected: |-
      false
    actual: |-
      { request: { method: 'POST', url: 'https://agcod-v2-gamma.amazon.com/CreateGiftCard', headers: { accept: 'application/json', 'content-type': 'application/json', 'x-amz-target': 'com.amazonaws.agcod.AGCODService.CreateGiftCard', Host: 'agcod-v2-gamma.amazon.com', 'Content-Length': 113, 'X-Amz-Date': '20220501T062941Z', Authorization: 'AWS4-HMAC-SHA256 Credential=ACCESSKEYID/20220501/us-east-1/AGCODService/aws4_request, SignedHeaders=accept;content-length;content-type;host;x-amz-date;x-amz-target, Signature=eebc6912759d0298643762be0b424039d149106ac667d03fff8757fb036035e7' }, body: '{"creationRequestId":"PARTNERID20kfimucyif","partnerId":"PARTNERID","value":{"amount":1000,"currencyCode":"USD"}}' }, statusCode: 403, message: 'The security token included in the request is invalid.' }
    at: <anonymous> (/Users/ekkis/dev/node-agcod/tests/certification.js:11:7)
    stack: |-
      Error: no error
          at Test.assert [as _assert] (/Users/ekkis/dev/node-agcod/node_modules/tape/lib/test.js:275:54)
          at Test.bound [as _assert] (/Users/ekkis/dev/node-agcod/node_modules/tape/lib/test.js:89:32)
          at Test.notOK (/Users/ekkis/dev/node-agcod/node_modules/tape/lib/test.js:407:10)
          at Test.bound [as notOk] (/Users/ekkis/dev/node-agcod/node_modules/tape/lib/test.js:89:32)
          at /Users/ekkis/dev/node-agcod/tests/certification.js:11:7
          at Request._callback (/Users/ekkis/dev/node-agcod/index.js:123:16)
          at Request.self.callback (/Users/ekkis/dev/node-agcod/node_modules/request/request.js:185:22)
          at Request.emit (events.js:375:28)
          at Request.<anonymous> (/Users/ekkis/dev/node-agcod/node_modules/request/request.js:1154:10)
          at Request.emit (events.js:375:28)
  ...
/Users/ekkis/dev/node-agcod/tests/certification.js:13
    t.equal(result.gcClaimCode.length > 0, true)
                   ^

TypeError: Cannot read property 'gcClaimCode' of undefined
    at /Users/ekkis/dev/node-agcod/tests/certification.js:13:20
    at Request._callback (/Users/ekkis/dev/node-agcod/index.js:123:16)
    at Request.self.callback (/Users/ekkis/dev/node-agcod/node_modules/request/request.js:185:22)
    at Request.emit (events.js:375:28)
    at Request.<anonymous> (/Users/ekkis/dev/node-agcod/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:375:28)
    at IncomingMessage.<anonymous> (/Users/ekkis/dev/node-agcod/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:481:28)
    at IncomingMessage.emit (events.js:387:35)
    at endReadableNT (internal/streams/readable.js:1317:12)
@ekkis
Copy link
Collaborator Author

ekkis commented May 2, 2022

I've fixed all the tests... they now pass but there's an issue with the credentials, as documented in #8

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

No branches or pull requests

1 participant