0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor(console): check mermaid by integration test env (#6183)

This commit is contained in:
Gao Sun 2024-07-04 23:18:00 +08:00 committed by GitHub
parent 9b3945a48d
commit 1c90671451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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';
@ -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,