title: TypeORM with multiple env setups
body: <p>I want to use a separate database for running tests. So I tried to configure TypeORM for multiple environments (dev and test) but it's not working. It only use the 'dev' configuration.</p>
  
  <p>This is my npm scripts:</p>
  
  <pre><code>"scripts": {
      "start": "NODE_ENV=dev node dist/index.js",
      "test": "NODE_ENV=test mocha --reporter spec --compilers ts:ts-node/register 'test/**/*.test.ts'"
  }
  </code></pre>
  
  <p>If I <code>console.log(process.env.NODE_ENV)</code> I get the correct results ("dev" / "test").</p>
  
  <p>This is my <code>ormconfig.json</code></p>
  
  <pre><code>[
    {
      "environment": "dev",
      "name": "default",
      "driver": {
        "type": "mysql",
        "host": "localhost",
        "port": 3306,
        "username": "root",
        "password": "",
        "database": "api"
      },
      "entities": [ "dist/model/*.js" ],
      "autoSchemaSync": true
    },
    {
      "environment": "test",
      "name": "default",
      "driver": {
        "type": "mysql",
        "host": "localhost",
        "port": 3306,
        "username": "root",
        "password": "",
        "database": "api_test"
      },
      "entities": [ "dist/model/*.js" ],
      "autoSchemaSync": true
    }
  ]
  </code></pre>
  
  <p>I connect with <code>createConnection();</code>. I manually created both databases <code>api</code> and <code>api_test</code> beforehand.</p>
  
  <p><strong>Why is TypeORM not using the "test" configuration when I set NODE_ENV=test?</strong></p>