 noError = (err) -> expect(err).to.equal(null)
 noData = (data) -> expect(data).to.equal(null)
 assertError = (err, code) -> expect(err.code).to.equal(code)
+matchError = (err, message) ->
+  expect(! !err.message.match(new RegExp(message, 'gi'))).to.eql(true)
 
 integrationTests = (fn) ->
   if config.accessKeyId and AWS.util.isBrowser()

        logStreamName: 'fake-stream'
      cloudwatchlogs.getLogEvents params, (err, data) ->
        assertError(err, 'ResourceNotFoundException')
        noData(data)
        done()


        StateReason: 'xyz'
      cloudwatch.setAlarmState params, (err, data) ->
        assertError(err, 'ValidationError')
        matchError(err, 'failed to satisfy constraint')
        noData(data)
        done()

