-
Notifications
You must be signed in to change notification settings - Fork 2
How to debug?
Vu Bao Nhu edited this page Mar 10, 2021
·
1 revision
You may have tried BotScript and want to discover more?
Here are tips that help you understand how it actually works!
Do steps following:
- Turn on test you are interested in
- Ignore other tests by comment
In the file test/mocha.opts
, look like:
--require ts-node/register
--reporter spec
--delay true
--retries 0 # do not need to retries on your local machine
--exit
#test/**/*.spec.ts
## test only 1 spec name: tracuu_bn
test/e2e/delay.spec.ts
test/e2e/tracuu_bn.spec.ts
By doing set the variable environment then you will see the debug logs:
Open termial and type:
# on windows
set DEBUG=BotScript:*
# see only info logs
set DEBUG=BotScript:INFO:*
Run npm test
to see the tests passed.
To debug on the browser, you open and go to playground at: https://play.botscript.ai/
Inspect or open DevTools:
# enter this command at console tab
localStorage.debug='BotScript:INFO:*'
# see all other logs
localStorage.debug='BotScript:*'
Then refresh the web page by enter F5 to see logs in console.
You can do:
- Run a spec test on Terminal
- Chat with bot on browser and see the logs.