vows/test/commands/*.js fails, but individual tests pass. #48

Closed
dominictarr opened this Issue Jun 23, 2011 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

dominictarr commented Jun 23, 2011

get this error:

mismatch in remote request :

{ method: 'GET',
  uri: 'http://api.mockjitsu.com:90210/apps/mickey/application/snapshots',
  headers: 
   { Authorization: 'Basic bWlja2V5OnBvaXV5dHJld3E=',
     'Content-Type': 'application/json' } }
{ method: 'GET',
  uri: 'http://api.mockjitsu.com:90210/auth',
  headers: 
   { Authorization: 'Basic bWlja2V5OnBvaXV5dHJld3E=',
     'Content-Type': 'application/json' } }

/home/dominic/source/dev/jitsu/test/helpers/mock-request.js:147
      throw ex;
      ^
<error: TypeError: Cannot call method 'match' of undefined>
    at [object Object]._request (/home/dominic/source/dev/jitsu/test/helpers/mock-request.js:135:14)
    at [object Object].request (/home/dominic/source/dev/jitsu/lib/jitsu/api/client.js:55:8)
    at [object Object].list (/home/dominic/source/dev/jitsu/lib/jitsu/api/snapshots.js:34:8)
    at executeList (/home/dominic/source/dev/jitsu/lib/jitsu/commands/snapshots.js:42:21)
    at Object.list (/home/dominic/source/dev/jitsu/lib/jitsu/commands/snapshots.js:77:3)
    at runCommand (/home/dominic/source/dev/jitsu/lib/jitsu/commands.js:109:13)
    at /home/dominic/source/dev/jitsu/lib/jitsu/commands.js:123:7
    at Object.auth (/home/dominic/source/dev/jitsu/lib/jitsu.js:165:12)
    at Object.run (/home/dominic/source/dev/jitsu/lib/jitsu/commands.js:118:18)
    at execCommand (/home/dominic/source/dev/jitsu/lib/jitsu.js:124:20)

there is two problems here, I think vows or something is obscuring the error real error, since request-mock is throwing an error during an async opperation, I don't know where the TypeError is coming from. there is not .match in the stack traced code.

but more to the point of jitsu, since jitsu has a private reference to whether it's logged in or not, then test/commands/apps.js is dirtying the state for test/commands/snapshots.js. when snapshots is run jitsu is already logged in so it does do and auth request.

is an /auth request even necessary since we are using basic auth and credentials get sent on every request?

Owner

indexzero commented Jun 23, 2011

  1. The TypeError is coming from inside of node.js core, which is why it is being obscured. It is being thrown inside of the equal I believe.
  2. This concept of "run individual file" and it passes and "run all files" and it fails is something I've seen before, I can poke around and abstract it away I think. I did it in haibu and our core pretty well.

@dominictarr Thanks for this, good catch. If you can take care of converting the other two test files I mentioned in the pull request I should be able to take a stab at this tomorrow and we can merge it in and move on.

Cheers.

Contributor

dominictarr commented Jun 23, 2011

yup, working on it.

Since this is my last week in US I'm catching up on some touristy things,
(today is computer histroy muesum!) but if not today, then definately
tomorrow.

On Thu, Jun 23, 2011 at 12:33 AM, indexzero <
reply@reply.github.com>wrote:

  1. The TypeError is coming from inside of node.js core, which is why it is
    being obscured. It is being thrown inside of the equal I believe.
  2. This concept of "run individual file" and it passes and "run all files"
    and it fails is something I've seen before, I can poke around and abstract
    it away I think. I did it in haibu and our core pretty well.

@dominictarr Thanks for this, good catch. If you can take care of
converting the other two test files I mentioned in the pull request I should
be able to take a stab at this tomorrow and we can merge it in and move on.

Cheers.

Reply to this email directly or view it on GitHub:
#48 (comment)

Contributor

dominictarr commented Jun 23, 2011

oh damn, some of the product code has changed and now the tests need to be
different (such as this commit to
nodejitsu/node-prompt@7de4316
prompt)

On Thu, Jun 23, 2011 at 10:15 AM, Dominic Tarr dominic.tarr@gmail.comwrote:

yup, working on it.

Since this is my last week in US I'm catching up on some touristy things,
(today is computer histroy muesum!) but if not today, then definately
tomorrow.

On Thu, Jun 23, 2011 at 12:33 AM, indexzero <
reply@reply.github.com>wrote:

  1. The TypeError is coming from inside of node.js core, which is why it is
    being obscured. It is being thrown inside of the equal I believe.
  2. This concept of "run individual file" and it passes and "run all files"
    and it fails is something I've seen before, I can poke around and abstract
    it away I think. I did it in haibu and our core pretty well.

@dominictarr Thanks for this, good catch. If you can take care of
converting the other two test files I mentioned in the pull request I should
be able to take a stab at this tomorrow and we can merge it in and move on.

Cheers.

Reply to this email directly or view it on GitHub:
#48 (comment)

Owner

indexzero commented Jun 25, 2011

This is fixed in head

indexzero closed this Jun 25, 2011

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