@Gary ********
So I just called Singapore Airlines and they said that the 48hr requirement applies to transiting passengers as well.
I found that hard to believe and so I went on their website and checked and indeed, on their website it says that also.
"Where a pre-departure test is also required at your planned destination, the stricter PDT requirement should apply. "
****************************************************************************
It also states on Singapore Air's site that the test is required to be taken no more than 48 hours before the flight. So that answers whether its before the departure or before the arrival.
"... required to take a pre-departure Covid-19 test within two days of their flight to Singapore".