     waitsFor -> err || tr
     runs ->
       expect(err.message).toEqual('Missing modules: invalidmodule')
-      runTransform tr(bundleFile), 'data', (e, out) ->
+      runTransform tr(servicesFile), 'data', (e, out) ->
         expect(e.message).toEqual(err.message)
         expect(out).toEqual(null)

# Assertions

assertBundle = (services, bundle, errMsg) ->
  runTransform transform(services, true)(bundleFile), 'data', (err, data) ->
    expect(err).toEqual(null)
    expect(data).toEqual(bundle)

assertBundleFailed = (services, errMsg) ->
  runTransform transform(services, true)(bundleFile), 'data', (err) ->
    expect(err.message).toEqual(errMsg)

describe 'bundle transformer', ->


# Bundle helpers

servicesFile = bundleHelpers.servicesFile
header = 'var AWS = require("./core"); module.exports = AWS;'
buildBundle = (services) ->
  data = [header]
