Error log is suppressed in unit test when following unit testing guide #15
Labels
pr: fix
Used on the docs repo for anything that is not "new" or "updated" content: chore, typos, fixes, etc.
severity: low
If the issue only affects a very niche base of users and an easily implemented workaround can solve
source: Dev Docs
PRs/issues targeting the Developer Docs
target: v3
Documentation PRs/issues targeting content from docs-v3.strapi.io (v3 branch)
Describe the bug
I’m following the unit testing guide and I hit an error because I didn’t have sqlite3 installed. No error was printed at the command line and I had to
console.log
from inside the framework to see what was wrong.Steps to reproduce the behavior
database.json
for thetest
env that references the sqlite client.yarn run test
Expected behavior
These lines in the framework are executing, thus an error should be printed:
Actual behavior
A callstack referencing
knex.js
is printed but the log messages are not visible.Code snippets
The line in strapi code that I expect an error from: https://github.com/strapi/strapi/blob/master/packages/strapi-connector-bookshelf/lib/knex.js#L79.
System
Additional context
I don't know if jest is swallowing the error or if
strapi.log.error
isn't emitting it. I followed the guide so I'd expect it to work. Also the guide should probably mention installing sqlite3. Thanks!The text was updated successfully, but these errors were encountered: