<commit_before>var assert = require("assert")
var m2server = require('../m2server')

describe('Array', function(){
  describe('#indexOf()', function(){
    it('should return -1 when the value is not present', function(){
      assert.equal(-1, [1,2,3].indexOf(5));
      assert.equal(-1, [1,2,3].indexOf(0));
    });
    it('should not be true', function() {
        assert(false);
    }); 
  })
})


describe('m2server', function(){
    it('should be available as a variable', function(){
        m2server.listen(8080);
        assert(true);
    })
})

<commit_msg>test for dummy server in mocha<commit_after>var assert = require("assert");
var http = require('http');
var m2server = require('../m2server');

describe('Array', function(){
  describe('#indexOf()', function(){
    it('should return -1 when the value is not present', function(){
      assert.equal(-1, [1,2,3].indexOf(5));
      assert.equal(-1, [1,2,3].indexOf(0));
    });
    it('should be true', function() {
        assert(true);
    }); 
  })
})


describe('m2server', function(){
    it('should be available as a variable', function(){
        m2server.listen(8080);
        assert(true);
    })
})

describe('testserver', function() {
    var server;
    before(function(done) {
        var http = require('http');
        server = http.createServer(function (req, res) {
          res.writeHead(200, {'Content-Type': 'text/plain'});
          res.end('Hello World\n');
        }).listen(1337, '127.0.0.1');
        console.log('Server running at http://127.0.0.1:1337/');
        
        server.on("listening", function() {
            console.log("started");
            done();
        });
    });
    it("Should fetch /", function(done) {
        http.get("http://localhost:1337/", function(res) {
            assert.equal(res.statusCode, 200);
            done();
        });
    });
    it("Should fetch Hello World", function(done) {
        http.get("http://localhost:1337/", function(res) {
            res.on('data', function(body) {
                console.log(body);
                assert.equal(body, "Hello World\n");
                done();
            });
        });
    });
        
    after(function(done){
      server.close();
      console.log("stopped");
      done();
    });
});




{'fraction_non_alphanumeric': 0.19176882661996497, 'fraction_numerical': 0.03152364273204904, 'mean_word_length': 2.3902077151335313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6668155', 'n_tokens_mistral': 724, 'n_tokens_neox': 684, 'n_words': 142}