Skip to content

Commit

Permalink
make import-jsx work in makeReporter
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 16, 2021
1 parent aef65e0 commit 0589591
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ const globFiles = files => Array.from(files.reduce((acc, f) =>
return set
}, new Set()))

const makeReporter = exports.makeReporter = (tap, options) => {
// caller-callsite requires that the call stack includes at least one
// spot where "this" is defined, so we bind this function to an object
// in this completely weird way, or else import-jsx doesn't work.
const makeReporter = exports.makeReporter = function (tap, options) {
const treportTypes = require('treport/types')
const tapMochaReporter = require('tap-mocha-reporter')
// if it's a treport type, use that
Expand Down Expand Up @@ -472,7 +475,7 @@ const makeReporter = exports.makeReporter = (tap, options) => {
`Invalid reporter: not a stream or react component ${reporter}`)
}
}
}
}.bind({})

const stdinOnly = options => {
// if we didn't specify any files, then just passthrough
Expand Down

0 comments on commit 0589591

Please sign in to comment.