Two words "Config transformations"
web-config-transformations
After you have your config transformations setup in your solution it is a small changes in Jenkins to the MSBuild step to add Command Line Arguments specifying the configuration
/t:Build /p:Configuration=Test