<commit_before>// Load modules

var Util = require('util');
var Stream = require('stream');
var Fs = require('fs');
var Zlib = require('zlib');
var Lab = require('lab');
var Shot = require('../lib');


// Declare internals

var internals = {};


// Test shortcuts

var lab = exports.lab = Lab.script();
var describe = lab.describe;
var it = lab.it;
var expect = Lab.expect;


describe('Shot', function () {

    describe('inject()', function () {

        it('returns non-chunked payload', function (done) {

            var output = 'example.com:8080|/hello';

            var dispatch = function (req, res) {

                res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': output.length });
                res.end(req.headers.host + '|' + req.url);
            };

            Shot.inject(dispatch, 'http://example.com:8080/hello', function (res) {

                expect(res.headers.date).to.exist;
                expect(res.headers.connection).to.exist;
                expect(res.headers['transfer-encoding']).to.not.exist;
                expect(res.payload).to.equal(output);<commit_msg>renamed test block.<commit_after>// Load modules

var Util = require('util');
var Stream = require('stream');
var Fs = require('fs');
var Zlib = require('zlib');
var Lab = require('lab');
var Shot = require('../lib');


// Declare internals

var internals = {};


// Test shortcuts

var lab = exports.lab = Lab.script();
var describe = lab.describe;
var it = lab.it;
var expect = Lab.expect;


describe('shot', function () {

    describe('inject()', function () {

        it('returns non-chunked payload', function (done) {

            var output = 'example.com:8080|/hello';

            var dispatch = function (req, res) {

                res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': output.length });
                res.end(req.headers.host + '|' + req.url);
            };

            Shot.inject(dispatch, 'http://example.com:8080/hello', function (res) {

                expect(res.headers.date).to.exist;
                expect(res.headers.connection).to.exist;
                expect(res.headers['transfer-encoding']).to.not.exist;
                expect(res.payload).to.equal(output);
{'fraction_non_alphanumeric': 0.1680035650623886, 'fraction_numerical': 0.00980392156862745, 'mean_word_length': 2.4860248447204967, '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': '2522521', 'n_tokens_mistral': 703, 'n_tokens_neox': 646, 'n_words': 145}