 
   s3 = null
   request = (operation, params) -> s3.makeRequest(operation, params)
+  regionReqOperation = if AWS.util.isNode() then 'headBucket' else 'listObjects'
 
   beforeEach (done) ->
     s3 = new AWS.S3(region: undefined)

    it 'does not make async request for bucket region if error.region is set', ->
      regionReq = send: (fn) ->
        fn()
      spy = helpers.spyOn(s3, 'listObjects').andReturn(regionReq)
      req = request('operation', {Bucket: 'name'})
      body = """
        <Error>

    it 'makes async request for bucket region if error.region not set for a region redirect error code', ->
      regionReq = send: (fn) ->
        fn()
      spy = helpers.spyOn(s3, regionReqOperation).andReturn(regionReq)
      params = Bucket: 'name'
      req = request('operation', params)
      body = """
