Need postman to wait for the population of an array before running tests, tried lots and lot, it’s just not working :(

Consider the script below, I need the 2nd for loop to finish running before the tests are run, I have tried lots, the only thing that works is setting interval, but this is problematic as it sporadically fails when run on postman monitor, is there another surefire way to make sure these tests are not run until the for loop has completed and populated the transitionNamesArray?

var jsonData = pm.response.json();
var getStateByIdUrl = pm.environment.get("host") + "/" + pm.environment.get("project-key") + "/states/";
var authToken = pm.environment.get("ctp_access_token");
let transitionsArray = jsonData.transitions;
let transitionNamesArray = [];
let transitionIdsArray = [];

for (let i = 0; i < jsonData.transitions.length; i++) {
    transitionIdsArray.push(jsonData.transitions[i].id);
}

console.log(transitionIdsArray)

async function getTransitionNames() {
    for (let t = 0; t < transitionIdsArray.length; t++) {
        const getRequestTransitions = {
            url: getStateByIdUrl + transitionIdsArray[t],
            method: 'GET',
            header: {
                'Authorization': 'Bearer ' + authToken
            }
        };

        await pm.sendRequest(getRequestTransitions, (err, res) => {
            res = res.json();
            transitionNamesArray.push(res.name['en'])
            console.log(transitionNamesArray);
        })

    }
    pm.test("Transitions contain 'Partially Delivered' and 'Delivered'", () => {
        pm.expect(transitionNamesArray).to.include("Delivered");
        pm.expect(transitionNamesArray).to.include("Partially Delivered");
    })

}

getTransitionNames()

I have tried running the getTransitionNames() function within pm.test() function, thinking it would run the function before attempting the pm.expect(), no luck, have tried loads of things, with no luck, at my wits’ end, please help 🙁