title: jest doesn't understand flow types and object destructuring?
body: <p>I keep on getting this error with flow types and jest:</p>
  
  <pre><code>TypeError: Cannot read property 'returnType' of undefined
  
    at builder (src/index.js:22:195)
    at Object.&lt;anonymous&gt; (__test__/index.spec.js:6:53)
    at process._tickCallback (internal/process/next_tick.js:103:7)
  </code></pre>
  
  <p>The following is my entire setup for this: </p>
  
  <p>application code:</p>
  
  <pre><code>// @flow
  type BuilderReturnType = {
      path: string,
      query: string
  }
  
  type BuilderOptionsType = {
      returnType?: string
  }
  
  export default function builder(path: string, {returnType = 'object'}: BuilderOptionsType): BuilderReturnType {
      const query = {};
      let queryResult = null;
      if (returnType === 'string') {
          queryResult = doSomething(query);
      }
      return {
          path,
          query: queryResult !== null ? queryResult : query
      }
  }
  </code></pre>
  
  <p><code>.babelrc</code> config:</p>
  
  <pre><code>{
      "presets": [
          "es2015", "jest"
      ],
      "plugins": [
          "transform-object-rest-spread",
          "transform-flow-strip-types"
      ],
      "env": {
          "test": {
              "presets": [
                  "es2015", "jest"
              ],
              "plugins": [
                  "transform-object-rest-spread",
                  "transform-flow-strip-types"
              ]
          }
      }
  }
  </code></pre>
  
  <p><code>jest.json</code> config:</p>
  
  <pre><code>{
    "bail": true,
    "verbose": true,
    "collectCoverage": true,
    "coverageDirectory": "./coverage",
    "coverageThreshold": {
      "global": {
        "branches": 100,
        "functions": 100,
        "lines": 100,
        "statements": 100
      }
    },
    "transform": {
      "^.+\\.js$": "&lt;rootDir&gt;/node_modules/babel-jest"
    }
  }
  </code></pre>
  
  <p>It seems that there are issues with the method signature using destructuring and flow types at the same time (<code>BuilderOptionsType</code> object):</p>
  
  <pre><code>    export default function builder(path: string, {returnType = 'object'}: BuilderOptionsType): BuilderReturnType { ... }
  </code></pre>
  
  <p>If I change <code>{returnType = 'object'}</code> to <code>options</code> and then destructure within the method, it seems to work completely fine. With that in mind, is that the only way to allow for using <code>jest</code> and <code>flow</code> types together? I'd prefer to be able to destructure in the signature instead of inside the method body.</p>