Vue-jest: Source map error using <style module> without a <template>

Created on 5 Nov 2018  路  2Comments  路  Source: vuejs/vue-jest

Starting v3.0.0, I'm seeing this error:

SyntaxError: Unexpected token m in JSON at position 0
        at JSON.parse (<anonymous>)

      at Object.parseSourceMapInput (node_modules/source-map-support/node_modules/source-map/lib/util.js:433:15)
      at new SourceMapConsumer (node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:17:22)
      at mapSourcePosition (node_modules/source-map-support/source-map-support.js:190:14)
      at wrapCallSite (node_modules/source-map-support/source-map-support.js:358:20)
      at node_modules/source-map-support/source-map-support.js:395:26
          at Array.map (<anonymous>)
      at Function.prepareStackTrace (node_modules/source-map-support/source-map-support.js:394:24)
          at Generator.throw (<anonymous>)

when trying to import a .vue file like below into a Jest test:

<script>
export default {
  render: h => h('div')
}
</script>

<style module>
.foo {
  color: orange;
}
</style>

The error even occurs with just:

<style module>
</style>

It goes away as soon as I add a <template> tag, e.g.:

```.vue