Updated Debugging (markdown)

WillieHabi 2024-06-06 10:41:00 -04:00
Родитель 134955f61c
Коммит 6048dfc57b
1 изменённых файлов: 9 добавлений и 0 удалений

@ -101,3 +101,12 @@ To further filter and only run a specified test, you can open the `.vscode/launc
```
*Note the `--no-timeouts` flag. If you do something that will cause a test to hang forever (like changing the driver to tinylicious without actually running the tinylicious server) it'll seem like the debugger isn't working*
### Break on failing assertions
When debugging your tests, you may want to break on all the failing asserts so you can inspect what is going wrong. To do this in VS Code, you can turn on "Caught Exceptions" and "Uncaught Exceptions" breakpoints and swap out the default nodejs assertion library with the [Chai assertion library](https://www.npmjs.com/package/chai). This can be done simply by installing Chai in the desired package using `pnpm install chai` and then replacing the nodejs assertion library with the Chai assertion library in the test file you want to debug:
```typescript
// import { strict as assert } from "assert"
import { assert } from 'chai'
```