A deceitful confidence trick, or mischief causing discomfort or annoyance.
I spotted his next shenanigan – saw it coming – and so avoided being fooled.