11import { ObjectId } from "mongodb" ;
2- import { parseTable , describeWithAtlas , afterAllWithRetry } from "./atlasHelpers.js" ;
2+ import { parseTable , describeWithAtlas , afterAllWithRetry , itWithRetry } from "./atlasHelpers.js" ;
33import { expectDefined , getDataFromUntrustedContent , getResponseElements } from "../../helpers.js" ;
4- import { describe , expect , it } from "vitest" ;
4+ import { describe , expect } from "vitest" ;
55
66const randomId = new ObjectId ( ) . toString ( ) ;
77
@@ -27,7 +27,7 @@ describeWithAtlas("projects", (integration) => {
2727 } ) ;
2828
2929 describe ( "atlas-create-project" , ( ) => {
30- it ( "should have correct metadata" , async ( ) => {
30+ itWithRetry ( "should have correct metadata" , async ( ) => {
3131 const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
3232 const createProject = tools . find ( ( tool ) => tool . name === "atlas-create-project" ) ;
3333 expectDefined ( createProject ) ;
@@ -36,7 +36,7 @@ describeWithAtlas("projects", (integration) => {
3636 expect ( createProject . inputSchema . properties ) . toHaveProperty ( "projectName" ) ;
3737 expect ( createProject . inputSchema . properties ) . toHaveProperty ( "organizationId" ) ;
3838 } ) ;
39- it ( "should create a project" , async ( ) => {
39+ itWithRetry ( "should create a project" , async ( ) => {
4040 const response = await integration . mcpClient ( ) . callTool ( {
4141 name : "atlas-create-project" ,
4242 arguments : { projectName : projName } ,
@@ -48,7 +48,7 @@ describeWithAtlas("projects", (integration) => {
4848 } ) ;
4949 } ) ;
5050 describe ( "atlas-list-projects" , ( ) => {
51- it ( "should have correct metadata" , async ( ) => {
51+ itWithRetry ( "should have correct metadata" , async ( ) => {
5252 const { tools } = await integration . mcpClient ( ) . listTools ( ) ;
5353 const listProjects = tools . find ( ( tool ) => tool . name === "atlas-list-projects" ) ;
5454 expectDefined ( listProjects ) ;
@@ -57,10 +57,9 @@ describeWithAtlas("projects", (integration) => {
5757 expect ( listProjects . inputSchema . properties ) . toHaveProperty ( "orgId" ) ;
5858 } ) ;
5959
60- it ( "returns project names" , async ( ) => {
60+ itWithRetry ( "returns project names" , async ( ) => {
6161 const response = await integration . mcpClient ( ) . callTool ( { name : "atlas-list-projects" , arguments : { } } ) ;
6262 const elements = getResponseElements ( response ) ;
63- expect ( elements ) . toHaveLength ( 2 ) ;
6463 expect ( elements [ 0 ] ?. text ) . toMatch ( / F o u n d \d + p r o j e c t s / ) ;
6564 expect ( elements [ 1 ] ?. text ) . toContain ( "<untrusted-user-data-" ) ;
6665 expect ( elements [ 1 ] ?. text ) . toContain ( projName ) ;
0 commit comments