7
7
} from "../../helpers.js" ;
8
8
import { describe , expect , it } from "vitest" ;
9
9
10
- const isMacOSInGitHubActions = process . platform === ' darwin' && process . env . GITHUB_ACTIONS === ' true'
10
+ const isMacOSInGitHubActions = process . platform === " darwin" && process . env . GITHUB_ACTIONS === " true" ;
11
11
12
12
describe ( "atlas-local-list-deployments" , ( ) => {
13
13
const integration = setupIntegrationTest (
@@ -21,11 +21,14 @@ describe("atlas-local-list-deployments", () => {
21
21
expectDefined ( listDeployments ) ;
22
22
} ) ;
23
23
24
- it . skipIf ( ! isMacOSInGitHubActions ) ( "[MacOS in GitHub Actions] should not have the atlas-local-list-deployments tool" , async ( ) => {
25
- const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
26
- const listDeployments = tools . find ( ( tool ) => tool . name === "atlas-local-list-deployments" ) ;
27
- expect ( listDeployments ) . toBeUndefined ( ) ;
28
- } ) ;
24
+ it . skipIf ( ! isMacOSInGitHubActions ) (
25
+ "[MacOS in GitHub Actions] should not have the atlas-local-list-deployments tool" ,
26
+ async ( ) => {
27
+ const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
28
+ const listDeployments = tools . find ( ( tool ) => tool . name === "atlas-local-list-deployments" ) ;
29
+ expect ( listDeployments ) . toBeUndefined ( ) ;
30
+ }
31
+ ) ;
29
32
30
33
it . skipIf ( isMacOSInGitHubActions ) ( "should have correct metadata" , async ( ) => {
31
34
const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
@@ -42,10 +45,17 @@ describe("atlas-local-list-deployments", () => {
42
45
arguments : { } ,
43
46
} ) ;
44
47
const elements = getResponseElements ( response . content ) ;
45
- expect ( elements ) . toHaveLength ( 2 ) ;
46
- expect ( elements [ 0 ] ?. text ) . toMatch ( / F o u n d \d + d e p l o y m e n t s / ) ;
47
- expect ( elements [ 1 ] ?. text ) . toContain (
48
- "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\n"
49
- ) ;
48
+ expect ( elements . length ) . toBeGreaterThanOrEqual ( 1 ) ;
49
+
50
+ if ( elements . length === 1 ) {
51
+ expect ( elements [ 0 ] ?. text ) . toContain ( "No deployments found." ) ;
52
+ }
53
+
54
+ if ( elements . length > 1 ) {
55
+ expect ( elements [ 0 ] ?. text ) . toMatch ( / F o u n d \d + d e p l o y m e n t s / ) ;
56
+ expect ( elements [ 1 ] ?. text ) . toContain (
57
+ "Deployment Name | State | MongoDB Version\n----------------|----------------|----------------\n"
58
+ ) ;
59
+ }
50
60
} ) ;
51
61
} ) ;
0 commit comments