
var mocha = require('fs').readFileSync(require.resolve('mocha/mocha.js'), 'utf8')
var profile = require('debug')('ecstacy:profile')

var Ecstacy = require('..')

Ecstacy.clean()
dryRun().then(function () {
  Ecstacy.clean()
  return withSourcemaps()
}).then(function () {
  Ecstacy.clean()
  return withoutSourcemaps()
}).catch(function (err) {
  throw err
})

function dryRun() {
  return Ecstacy.js({
    name: 'klajsdf',
    code: '',
  }).build()
}

function withSourcemaps() {
  profile('profiling mocha.js with sourcemaps')
  return Ecstacy.js({
    name: 'mocha1',
    code: mocha,
  }).build().then(function () {
    profile('built mocha.js with sourcemaps')
  })
}

function withoutSourcemaps() {
  profile('profiling mocha.js without sourcemaps')
  return Ecstacy.js({
    name: 'mocha2',
    code: mocha,
    sourcemaps: false,
  }).build().then(function () {
    profile('built mocha.js without sourcemaps')
  })
}

@@ -583,16 +583,38 @@
  mocha,%0A
+    transforms: true,%0A
   %7D).bui
@@ -855,16 +855,38 @@
  false,%0A
+    transforms: true,%0A
   %7D).bui

update benchmarks