@@ -20,7 +20,7 @@ import {
2020 branchAlias ,
2121 branchAliasUpdate
2222} from '../mock/configurations.js'
23- import { validateBranchResponse , testData , wait , shortId } from '../utility/testHelpers.js'
23+ import { validateBranchResponse , testData , wait , shortId , trackedExpect } from '../utility/testHelpers.js'
2424
2525describe ( 'Branch API Tests' , ( ) => {
2626 let client
@@ -48,19 +48,17 @@ describe('Branch API Tests', () => {
4848 it ( 'should query all branches' , async ( ) => {
4949 const response = await stack . branch ( ) . query ( ) . find ( )
5050
51- expect ( response ) . to . be . an ( 'object' )
52- expect ( response . items || response . branches ) . to . be . an ( 'array' )
53-
51+ trackedExpect ( response , 'Branches response' ) . toBeAn ( 'object' )
5452 const items = response . items || response . branches
55- // At least main branch should exist
56- expect ( items . length ) . to . be . at . least ( 1 )
53+ trackedExpect ( items , 'Branches list' ) . toBeAn ( 'array' )
54+ trackedExpect ( items . length , 'Branches count' ) . toBeAtLeast ( 1 )
5755 } )
5856
5957 it ( 'should fetch main branch' , async ( ) => {
6058 const response = await stack . branch ( 'main' ) . fetch ( )
6159
62- expect ( response ) . to . be . an ( 'object' )
63- expect ( response . uid ) . to . equal ( 'main' )
60+ trackedExpect ( response , 'Main branch' ) . toBeAn ( 'object' )
61+ trackedExpect ( response . uid , 'Main branch UID' ) . toEqual ( 'main' )
6462 } )
6563
6664 it ( 'should create a development branch from main' , async function ( ) {
@@ -77,11 +75,11 @@ describe('Branch API Tests', () => {
7775 // SDK returns the branch object directly
7876 const branch = await stack . branch ( ) . create ( branchData )
7977
80- expect ( branch ) . to . be . an ( 'object' )
81- expect ( branch . uid ) . to . be . a ( 'string' )
78+ trackedExpect ( branch , 'Branch' ) . toBeAn ( 'object' )
79+ trackedExpect ( branch . uid , 'Branch UID' ) . toBeA ( 'string' )
8280 validateBranchResponse ( branch )
8381
84- expect ( branch . uid ) . to . equal ( devBranchUid )
82+ trackedExpect ( branch . uid , 'Branch UID' ) . toEqual ( devBranchUid )
8583 expect ( branch . source ) . to . equal ( 'main' )
8684
8785 createdBranch = branch
0 commit comments