apps/docs/src/guide/testing/launching-a-test-node.md
To simplify testing in isolation, we provide a utility called launchTestNode.
It allows you to spin up a short-lived fuel-core node, set up a custom provider, wallets, deploy contracts, and much more in one go.
For usage information for launchTestNode including it's inputs, outputs and options, please check the API reference.
We support explicit resource management, introduced in TypeScript 5.2, which automatically calls a cleanup function after a variable instantiated with the using keyword goes out of block scope:
<<< @./snippets/launching-a-test-node.ts#automatic-cleanup{ts:line-numbers}
To use explicit resource management, you must:
5.2 or abovees2022 or belowesnext or esnext.disposable{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022", "esnext.disposable"]
}
}
If you don't want, or can't use explicit resource management, you can use const as usual.
In this case, remember you must call .cleanup() to dispose of the node.
<<< @./snippets/launching-a-test-node.ts#manual-cleanup{ts:line-numbers}