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 on Windows #31

Closed
felixfbecker opened this issue Oct 19, 2015 · 2 comments · Fixed by #32
Closed

Tests fail on Windows #31

felixfbecker opened this issue Oct 19, 2015 · 2 comments · Fixed by #32

Comments

@felixfbecker
Copy link
Contributor

Wanted to work on async/await support and did nothing but git clone, npm install, npm test.

send(ctx, file)
    √ should set the Content-Type (38ms)
    √ should set the Content-Length

  Error: boom
      at Object.<anonymous> (C:\Users\felix\git\send\test\index.js:448:33)
      at next (native)
      at Object.<anonymous> (C:\Users\felix\git\send\node_modules\koa-compose\index.js:29:12)
      at next (native)
      at onFulfilled (C:\Users\felix\git\send\node_modules\co\index.js:65:19)

    √ should cleanup on socket error
    with no .root
      when the path is absolute
        1) should 404
      when the path is relative
        √ should 200
      when the path contains ..
        √ should 403
    with .root
      when the path is absolute
        2) should 404
      when the path is relative and exists
        √ should serve the file
      when the path is relative and does not exist
        √ should 404
      when the path resolves above the root
        √ should 403
      when the path resolves within root
        √ should 403
    with .index
      when the index file is present
        √ should serve it
        √ should serve it
    when path is not a file
      √ should 404
      √ should return undefined
    when path is a directory
      √ should 404
    when path does not finish with slash and format is disabled
      √ should 404
      √ should 404
    when path does not finish with slash and format is enabled
      3) should 200
double callback!
    when path is malformed
      √ should 400
    when path is a file

  AssertionError: 'C:\\Users\\felix\\git\\send\\test\\fixtures\\user.json' == 'C:\\Users\\felix\\git\\send\\test/fixtures/user.json'
      at Object.<anonymous> (C:\Users\felix\git\send\test\index.js:269:16)
      at next (native)
      at Object.<anonymous> (C:\Users\felix\git\send\node_modules\koa-compose\index.js:29:12)
      at next (native)
      at onFulfilled (C:\Users\felix\git\send\node_modules\co\index.js:65:19)

      4) should return the path
      or .gz version when requested and if possible
        √ should return path
        √ should return .gz path (gzip option defaults to true)
        √ should return .gz path when gzip option is turned on
        √ should not return .gz path when gzip option is false
      and max age is specified

  AssertionError: 'C:\\Users\\felix\\git\\send\\test\\fixtures\\user.json' == 'C:\\Users\\felix\\git\\send\\test/fixtures/user.json'
      at Object.<anonymous> (C:\Users\felix\git\send\test\index.js:346:18)
      at next (native)
      at Object.<anonymous> (C:\Users\felix\git\send\node_modules\koa-compose\index.js:29:12)
      at next (native)
      at onFulfilled (C:\Users\felix\git\send\node_modules\co\index.js:65:19)

        5) should set max-age in seconds

  AssertionError: 'C:\\Users\\felix\\git\\send\\test\\fixtures\\user.json' == 'C:\\Users\\felix\\git\\send\\test/fixtures/user.json'
      at Object.<anonymous> (C:\Users\felix\git\send\test\index.js:361:18)
      at next (native)
      at Object.<anonymous> (C:\Users\felix\git\send\node_modules\koa-compose\index.js:29:12)
      at next (native)
      at onFulfilled (C:\Users\felix\git\send\node_modules\co\index.js:65:19)

        6) should truncate fractional values for max-age
    .hidden option
      when trying to get a hidden file
        7) should 404
      when trying to get a file from a hidden directory
        8) should 404
      when trying to get a hidden file and .hidden check is turned off
        √ should 200


  22 passing (234ms)
  8 failing

  1) send(ctx, file) with no .root when the path is absolute should 404:
     Error: expected 404 "Not Found", got 400 "Bad Request"
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:205:15)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  2) send(ctx, file) with .root when the path is absolute should 404:
     Error: expected 404 "Not Found", got 400 "Bad Request"
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:205:15)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  3) send(ctx, file) when path does not finish with slash and format is enabled should 200:
     Error: Parse Error
      at Error (native)
      at Socket.socketOnData (_http_client.js:305:20)
      at readableAddChunk (_stream_readable.js:146:16)
      at Socket.Readable.push (_stream_readable.js:110:10)
      at TCP.onread (net.js:523:20)

  4) send(ctx, file) when path is a file should return the path:
     Error: expected 200 "OK", got 500 "Internal Server Error"
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:205:15)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  5) send(ctx, file) when path is a file and max age is specified should set max-age in seconds:
     Error: expected "Cache-Control" header field
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:190:35)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  6) send(ctx, file) when path is a file and max age is specified should truncate fractional values for max-age:
     Error: expected "Cache-Control" header field
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:190:35)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  7) send(ctx, file) .hidden option when trying to get a hidden file should 404:
     Error: expected 404 "Not Found", got 200 "OK"
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:205:15)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)

  8) send(ctx, file) .hidden option when trying to get a file from a hidden directory should 404:
     Error: expected 404 "Not Found", got 200 "OK"
      at Test.assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:205:15)
      at assert (C:\Users\felix\git\send\node_modules\supertest\lib\test.js:132:12)
      at C:\Users\felix\git\send\node_modules\supertest\lib\test.js:129:5
      at Test.Request.callback (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\felix\git\send\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:893:12)
@jonathanong
Copy link
Member

oh because you're on windows :(

@tejasmanohar tejasmanohar changed the title Tests fail on fresh clone Tests fail on Windows Oct 21, 2015
@felixfbecker
Copy link
Contributor Author

Guys I found the issue. Working on a fix.

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

Successfully merging a pull request may close this issue.

2 participants