You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Definitely agree that doc-examples.test.ts should be moved to doc-snippets, going to reference #1043 as this could be picked up there as part of the wider work to reorganise/recategorise tests.
Don't these #context bits defeat the purpose of having unit-tested docs?
It does however this is a difficult playoff between keeping our snippets clean vs completely unit tested. I investigated trying to keep the actual imports inside the snippet region, then the describe and test would just do an assertion for the code inside the snippet region, essentially ending up with a snippet per file. But I there a few slip ups such as async code where you'd need it at least inside a function block.
Honestly I think my preference is to stay as is until a unit testable solution is found rather than add noise to snippets.
In this page, the third line of the first code block uses a variable that has never been imported:
This is the source:
fuels-ts/packages/fuel-gauge/src/doc-examples.test.ts
Lines 267 to 275 in b3b59e2
The fix is simple:
// #context import { Provider, FUEL_NETWORK_URL } from 'fuels';
But I wonder:
#context
bits defeat the purpose of having unit-tested docs?doc-examples.test.ts
be placed in thedoc-snippets
?The text was updated successfully, but these errors were encountered: