Skip to content
This repository has been archived by the owner on Apr 26, 2019. It is now read-only.

Fixed a trouble with incorrect reply #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

TngSam
Copy link

@TngSam TngSam commented Jan 20, 2019

The reply calls a function when continue is a Symbol. This leads to errors.

The reply was calling a function when `continue` is a Symbol.
@ci-reporter
Copy link

ci-reporter bot commented Jan 20, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Travis CI build is failing as of 2dd57b7. Here's the output:

npm test
> hapi-cors-headers@ pretest /home/travis/build/gr2m/hapi-cors-headers
> standard


> hapi-cors-headers@ test /home/travis/build/gr2m/hapi-cors-headers
> tap --100 --coverage tests

tests/index.js ...................................... 14/18
  request.headers.origin is undefined
  not ok reply.continue called
    +++ found                                                           
    --- wanted                                                          
    -true                                                               
    +false                                                              
    compare: ===
    at:
      line: 1
      column: 5409
      file: tests/index.js
      type: Test
    stack: >
      Test.<anonymous> (tests/index.js:1:5409)
    
      Object.<anonymous> (tests/index.js:1:4954)
    
      Module.replacementCompile
      (node_modules/nyc/node_modules/append-transform/index.js:58:13)
    
      module.exports
      (node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    
      Object.<anonymous>
      (node_modules/nyc/node_modules/append-transform/index.js:62:4)
    
      Object.<anonymous> (node_modules/nyc/bin/wrap.js:23:4)
    source: >
      (function (exports, require, module, __filename, __dirname) { var test =
      require('tap').test
  
  request is boom error
  not ok reply.continue called
    +++ found                                                           
    --- wanted                                                          
    -true                                                               
    +false                                                              
    compare: ===
    at:
      line: 1
      column: 6339
      file: tests/index.js
      type: Test
    stack: >
      Test.<anonymous> (tests/index.js:1:6339)
    
      Object.<anonymous> (tests/index.js:1:5517)
    
      Module.replacementCompile
      (node_modules/nyc/node_modules/append-transform/index.js:58:13)
    
      module.exports
      (node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    
      Object.<anonymous>
      (node_modules/nyc/node_modules/append-transform/index.js:62:4)
    
      Object.<anonymous> (node_modules/nyc/bin/wrap.js:23:4)
    source: >
      (function (exports, require, module, __filename, __dirname) { var test =
      require('tap').test
  
  options request without acces-control-request headers
  not ok reply.continue called
    +++ found                                                           
    --- wanted                                                          
    -true                                                               
    +false                                                              
    compare: ===
    at:
      line: 1
      column: 7561
      file: tests/index.js
      type: Test
    stack: >
      Test.<anonymous> (tests/index.js:1:7561)
    
      Object.<anonymous> (tests/indeunction (exports, require, module, __filename, __dirname) { var test =
      require('tap').test

total ............................................... 14/18
  

  14 passing (893.036ms)
  4 failing

ERROR: Coverage for lines (93.75%) does not meet global threshold (100%)
ERROR: Coverage for functions (55.56%) does not meet global threshold (100%)
ERROR: Coverage for statements (93.75%) does not meet global threshold (100%)
-------------------------|----------|----------|----------|----------|-------------------|
File                     |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
-------------------------|----------|----------|----------|----------|-------------------|
All files                |    93.75 |      100 |    55.56 |    93.75 |                   |
 hapi-cors-headers       |      100 |      100 |      100 |      100 |                   |
  index.js               |      100 |      100 |      100 |      100 |                   |
 hapi-cors-headers/tests |    91.67 |      100 |       50 |    91.67 |                   |
  index.js               |    91.67 |      100 |       50 |    91.67 |       11,36,61,89 |
-------------------------|----------|----------|----------|----------|-------------------|

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


Failed build for a63ed3d
npm test
> hapi-cors-headers@ pretest /home/travis/build/gr2m/hapi-cors-headers
> standard

standard: Use JavaScript Standard Style (https://standardjs.com)
  /home/travis/build/gr2m/hapi-cors-headers/index.js:29:3: Expected an assignment or function call and instead saw an expression.

This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@gr2m
Copy link
Owner

gr2m commented Jan 20, 2019

What hapi version are you using? Might this be a recent change?

@TngSam
Copy link
Author

TngSam commented Jan 26, 2019

What hapi version are you using? Might this be a recent change?

I'm using version 17.8.1 and I think you're absolutely right, it might be new changes.
Also I want to amend my recent pull request, because it contains a typo. Sorry.
I ran into this problem 6 days ago. Console told me something like 'reply.continue is not a function'. Thank you for your reply! :)

@gr2m
Copy link
Owner

gr2m commented Jan 26, 2019

Can you research what the reply.continue() alternative is then in the latest version? I’d like it to be compatible with both

@TngSam
Copy link
Author

TngSam commented Feb 5, 2019

Can you research what the reply.continue() alternative is then in the latest version? I’d like it to be compatible with both

OK!

@gr2m
Copy link
Owner

gr2m commented Feb 5, 2019

See also #23

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

Successfully merging this pull request may close these issues.

2 participants