Skip to content

Commit

Permalink
refactor(console): check mermaid by integration test env (#6183)
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Jul 4, 2024
1 parent 9b3945a commit 1c90671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/console/src/mdx-components/Mermaid/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Theme } from '@logto/schemas';
import { noop } from '@silverhand/essentials';
import { noop, yes } from '@silverhand/essentials';
import { type Mermaid as MermaidType } from 'mermaid';
import { useEffect } from 'react';

Expand All @@ -21,8 +21,8 @@ const loadMermaid = async () => {
return imported.default;
};

const mermaidPromise = process.env.CI
? // Mock Mermaid in CI to avoid issues with network requests and testing environment.
const mermaidPromise = yes(process.env.INTEGRATION_TEST)
? // Mock Mermaid in integration tests to avoid issues with network requests and testing environment.
Promise.resolve({
initialize: noop,
run: noop,
Expand Down

0 comments on commit 1c90671

Please sign in to comment.