1
1
import { ObjectId } from "mongodb" ;
2
- import { parseTable , describeWithAtlas , afterAllWithRetry } from "./atlasHelpers.js" ;
2
+ import { parseTable , describeWithAtlas , afterAllWithRetry , itWithRetry } from "./atlasHelpers.js" ;
3
3
import { expectDefined , getDataFromUntrustedContent , getResponseElements } from "../../helpers.js" ;
4
- import { describe , expect , it } from "vitest" ;
4
+ import { describe , expect } from "vitest" ;
5
5
6
6
const randomId = new ObjectId ( ) . toString ( ) ;
7
7
@@ -27,7 +27,7 @@ describeWithAtlas("projects", (integration) => {
27
27
} ) ;
28
28
29
29
describe ( "atlas-create-project" , ( ) => {
30
- it ( "should have correct metadata" , async ( ) => {
30
+ itWithRetry ( "should have correct metadata" , async ( ) => {
31
31
const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
32
32
const createProject = tools . find ( ( tool ) => tool . name === "atlas-create-project" ) ;
33
33
expectDefined ( createProject ) ;
@@ -36,7 +36,7 @@ describeWithAtlas("projects", (integration) => {
36
36
expect ( createProject . inputSchema . properties ) . toHaveProperty ( "projectName" ) ;
37
37
expect ( createProject . inputSchema . properties ) . toHaveProperty ( "organizationId" ) ;
38
38
} ) ;
39
- it ( "should create a project" , async ( ) => {
39
+ itWithRetry ( "should create a project" , async ( ) => {
40
40
const response = await integration . mcpClient ( ) . callTool ( {
41
41
name : "atlas-create-project" ,
42
42
arguments : { projectName : projName } ,
@@ -48,7 +48,7 @@ describeWithAtlas("projects", (integration) => {
48
48
} ) ;
49
49
} ) ;
50
50
describe ( "atlas-list-projects" , ( ) => {
51
- it ( "should have correct metadata" , async ( ) => {
51
+ itWithRetry ( "should have correct metadata" , async ( ) => {
52
52
const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
53
53
const listProjects = tools . find ( ( tool ) => tool . name === "atlas-list-projects" ) ;
54
54
expectDefined ( listProjects ) ;
@@ -57,10 +57,9 @@ describeWithAtlas("projects", (integration) => {
57
57
expect ( listProjects . inputSchema . properties ) . toHaveProperty ( "orgId" ) ;
58
58
} ) ;
59
59
60
- it ( "returns project names" , async ( ) => {
60
+ itWithRetry ( "returns project names" , async ( ) => {
61
61
const response = await integration . mcpClient ( ) . callTool ( { name : "atlas-list-projects" , arguments : { } } ) ;
62
62
const elements = getResponseElements ( response ) ;
63
- expect ( elements ) . toHaveLength ( 2 ) ;
64
63
expect ( elements [ 0 ] ?. text ) . toMatch ( / F o u n d \d + p r o j e c t s / ) ;
65
64
expect ( elements [ 1 ] ?. text ) . toContain ( "<untrusted-user-data-" ) ;
66
65
expect ( elements [ 1 ] ?. text ) . toContain ( projName ) ;
0 commit comments