<commit_before>import {describe, it} from 'mocha';

describe('Arbitrary HTTP routes', () => {
  describe('database.route', () => {
    it('is missing tests');
  });
});<commit_msg>Add test for database.route<commit_after>import {describe, it} from 'mocha';
import {expect} from 'chai';
import {Database} from '../src';
import Route from '../src/route';

describe('Arbitrary HTTP routes', () => {
  const db = new Database();
  describe('database.route', () => {
    it('returns a Route instance', () => {
      let route = db.route();
      expect(route).to.be.an.instanceof(Route);
    });
    it('creates a route for the given path', () => {
      let path = '/hi';
      let route = db.route(path);
      expect(route._path).to.equal(path);
    });
    it('passes the given headers to the new route', () => {
      let route = db.route('/hello', {'x-magic': 'awesome'});
      expect(route._headers).to.have.a.property('x-magic', 'awesome');
    });
  });
});
{'fraction_non_alphanumeric': 0.20686070686070687, 'fraction_numerical': 0.0, 'mean_word_length': 3.3772727272727274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4356519', 'n_tokens_mistral': 312, 'n_tokens_neox': 303, 'n_words': 77}