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

fix: broken tests #206

Conversation

cesarvspr
Copy link
Contributor

Checklist

After:


 FAIL ​ test/global.test.js
 ✖ onRequest hook should be a function, instead got object

          } else if (opts[hook] !== undefined && typeof opts[hook] !== 'function') {
            throw new FST_ERR_HOOK_INVALID_HANDLER(hook, typeof opts[hook])
------------------^
          }
        }

  test: It should add hooks correctly
  stack: |
    Object.addNewRoute (node_modules/fastify/lib/route.js:256:19)
    Object.route (node_modules/fastify/lib/route.js:217:19)
    Object.prepareRoute (node_modules/fastify/lib/route.js:150:18)
    Object._get [as get] (node_modules/fastify/fastify.js:249:34)
    Test.<anonymous> (test/global.test.js:401:11)
  at:
    line: 256
    column: 19
    file: node_modules/fastify/lib/route.js
    function: Object.addNewRoute
  type: FastifyError
  code: FST_ERR_HOOK_INVALID_HANDLER
  statusCode: 500
  tapCaught: returnedPromiseRejection

now: Tests don't break.

@cesarvspr
Copy link
Contributor Author

fyi: @mcollina @climba03003

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit e288315 into fastify:master Oct 25, 2022
@cesarvspr cesarvspr deleted the fix-broken-test-hook-expected-function-got-object branch October 25, 2022 12:31
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 this pull request may close these issues.

2 participants