<commit_before>var Lab = require('lab');

var describe = Lab.experiment;
var it = Lab.test;
var expect = Lab.expect;
var beforeEach = Lab.beforeEach;
var mw = require('dat-middleware');
var createAppWithMiddleware = require('./fixtures/createAppWithMiddlewares');
var ExpressRequest = require('../index');

describe('unsupported functionality', function() {
  describe('res', function() {
    describe('write', function() {
      beforeEach(function (done) {
        app = createAppWithMiddleware(
          mw.res.write('hello')
        );
        done();
      });
      it('should error', function (done) {
        var request = new ExpressRequest(app);
        var query = { foo: 1 };
        request.get('/hey', { qs: query }, function (err, res, body) {
          expect(res).to.be.ok;
          expect(res.statusCode).to.equal(500);
          expect(res.body).to.match(/res.write/);
          done();
        });
      });
    });
    describe('code', function() {
      beforeEach(function (done) {
        app = createAppWithMiddleware(
          function (req, res, next) {
            res.code(100);
          }
        );
        done();
      });
      it('should error', function (done) {
        var request = new ExpressRequest(app);
        var query = { foo: 1 };
        request.get('/hey', { qs: query }, function (err, res, body) {
          expect(res).to.be.ok;
          expect(res.statusCode).to.equal(500);
          expect(res.body).to.match(/res.code/);
          done();
        });
      });
    });
    describe('end', function() {
      beforeEach(function (done) {
        app = createAppWithMiddleware(
          mw.res.end('hello')
        );
        done();
      });
      it('should error', function (done) {
        var request = new ExpressRequest(app);
        var query = { foo: 1 };
        request.get('/hey', { req:{connection:{}} }, function (err, res, body) {
          expect(res).to.be.ok;
          expect(res.statusCode).to.equal(500);
          expect(res.body).to.match(/res.end/);
          done();
        });
      });
    });
  });
});<commit_msg>remove unsupported end test<commit_after>var Lab = require('lab');

var describe = Lab.experiment;
var it = Lab.test;
var expect = Lab.expect;
var beforeEach = Lab.beforeEach;
var mw = require('dat-middleware');
var createAppWithMiddleware = require('./fixtures/createAppWithMiddlewares');
var ExpressRequest = require('../index');

describe('unsupported functionality', function() {
  describe('res', function() {
    describe('write', function() {
      beforeEach(function (done) {
        app = createAppWithMiddleware(
          mw.res.write('hello')
        );
        done();
      });
      it('should error', function (done) {
        var request = new ExpressRequest(app);
        var query = { foo: 1 };
        request.get('/hey', { qs: query }, function (err, res, body) {
          expect(res).to.be.ok;
          expect(res.statusCode).to.equal(500);
          expect(res.body).to.match(/res.write/);
          done();
        });
      });
    });
    describe('code', function() {
      beforeEach(function (done) {
        app = createAppWithMiddleware(
          function (req, res, next) {
            res.code(100);
          }
        );
        done();
      });
      it('should error', function (done) {
        var request = new ExpressRequest(app);
        var query = { foo: 1 };
        request.get('/hey', { qs: query }, function (err, res, body) {
          expect(res).to.be.ok;
          expect(res.statusCode).to.equal(500);
          expect(res.body).to.match(/res.code/);
          done();
        });
      });
    });
  });
});

{'fraction_non_alphanumeric': 0.16893732970027248, 'fraction_numerical': 0.007084468664850136, 'mean_word_length': 2.118946474086661, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3700090', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1075, 'n_words': 223}