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
* If `true` the tests will be hidden and the logs will be supressed. This is useful when you want to run tests in the background and don't want to show the tests to the user.
Copy file name to clipboardExpand all lines: website/docs/src/pages/advanced-usage/components.mdx
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,6 +504,36 @@ export default () => (
504
504
`}
505
505
</CodeBlock>
506
506
507
+
### Hiding Tests
508
+
509
+
You can hide the test files using the `visibleFiles`prop. Additionally, if you want to suppress test content and only show the test results, you can use the `hideTestsAndSuppressLogs` option.
510
+
This option will hide the test files, suppress the console logs, and disable the verbose button.
511
+
512
+
<CodeBlock stack>
513
+
{`
514
+
import {
515
+
SandpackProvider,
516
+
SandpackLayout,
517
+
SandpackCodeEditor,
518
+
SandpackTests,
519
+
} from "@codesandbox/sandpack-react";
520
+
521
+
export default () => (
522
+
<SandpackProvider
523
+
template="test-ts"
524
+
options={{
525
+
visibleFiles: ["/add.ts"],
526
+
}}
527
+
>
528
+
<SandpackLayout>
529
+
<SandpackCodeEditor />
530
+
<SandpackTests hideTestsAndSupressLogs />
531
+
</SandpackLayout>
532
+
</SandpackProvider>
533
+
);
534
+
`}
535
+
</CodeBlock>
536
+
507
537
## Console
508
538
509
539
`SandpackConsole` is a Sandpack devtool that allows printing the console logs from a Sandpack client. It is designed to be a light version of a browser console, which means that it's limited to a set of common use cases you may encounter when coding.
@@ -672,4 +702,4 @@ of them comunicate with sandpack through the shared context.
672
702
<Callout icon="🎉">
673
703
**Congrats!**<br/>
674
704
You can now easily create a custom Sandpack component by reusing some of the building components of the library. The next step is to build your own sandpack components with the help of our custom hooks.
0 commit comments