For example, bitcoin-ruby allows you to do this:
# use testnet so you don't acidentially your whole money!
Bitcoin.network = :testnet3
Or cryptocoinjs
PackageName.defaultNetwork = 'testnet'
If we can globally set network type then I will be able to start writing some integration tests for bitcoinjs-lib