<commit_before>var hippie = require("hippie"),
	path = require("path"),
	server = require(path.join("..", "index.js")),
	etag = "";

function request () {
	return hippie().base("http://localhost:8001");
}

server({
	default: "test",
	root: path.join(__dirname, "..", "sites"),
	port: 8001,
	logging: {
		enabled: false
	},
	hosts: {
		"test": "test"
	}
}).start();

describe("Valid Requests", function () {
	it("GET / (200 / 'Hello World!')", function (done) {
		request()
			.get("/")
			.expectStatus(200)
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")
			.expectHeader("transfer-encoding", "chunked")
			.expectHeader("content-length", undefined)
			.expectBody(/Hello world!/)
			.end(function (err, res) {
				if (err) throw err;
				etag = res.headers.etag;
				done();
			});
	});

	it("HEAD / (200 / empty)", function (done) {
		request()
			.head("/")
			.expectStatus(200)
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")<commit_msg>Adding basic gzip/deflate tests<commit_after>var hippie = require("hippie"),
	path = require("path"),
	server = require(path.join("..", "index.js")),
	etag = "";

function request () {
	return hippie().base("http://localhost:8001");
}

server({
	default: "test",
	root: path.join(__dirname, "..", "sites"),
	port: 8001,
	logging: {
		enabled: false
	},
	hosts: {
		"test": "test"
	}
}).start();

describe("Valid Requests", function () {
	it("GET / (200 / 'Hello World!')", function (done) {
		request()
			.get("/")
			.expectStatus(200)
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")
			.expectHeader("transfer-encoding", "chunked")
			.expectHeader("content-length", undefined)
			.expectBody(/Hello world!/)
			.end(function (err, res) {
				if (err) throw err;
				etag = res.headers.etag;
				done();
			});
	});

	it("GET / (200 / 'Hello World!' - gzip)", function (done) {
		request()
			.get("/")
			.header("accept-encoding", "gzip")
			.expectStatus(200)
			.expectHeader("content-encoding", "gzip")
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")
			.expectHeader("transfer-encoding", "chunked")
			.expectHeader("content-length", undefined)
			.end(function (err, res) {
				if (err) throw err;
				done();
			});
	});

	it("GET / (200 / 'Hello World!' - deflate)", function (done) {
		request()
			.get("/")
			.header("accept-encoding", "deflate")
			.expectStatus(200)
			.expectHeader("content-encoding", "deflate")
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")
			.expectHeader("transfer-encoding", "chunked")
			.expectHeader("content-length", undefined)
			.end(function (err, res) {
				if (err) throw err;
				done();
			});
	});

	it("HEAD / (200 / empty)", function (done) {
		request()
			.head("/")
			.expectStatus(200)
			.expectHeader("status", "200 OK")
			.expectHeader("allow", "GET, HEAD, OPTIONS")
{'fraction_non_alphanumeric': 0.21648091860857818, 'fraction_numerical': 0.02364066193853428, 'mean_word_length': 3.679304897314376, 'pattern_counts': {'":': 2, '<': 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': '7514238', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1026, 'n_words': 224}