feat(trace): add export condition and clean up tests (#9499)
### Description
- Added a `types` export condition
- Cleaned up tests to not use third party packages, just mocks
### Testing Instructions
<!--
Give a quick description of steps to test your changes.
-->