<commit_before>var assert = require('assert'),
    mediatype = require('../mediatype')

function eq(a, b) { assert.strictEqual(a, b) }

describe('mediatype', function () {
    it('should have useful defaults', function () {
        assert(Object.keys(mediatype.types).length > 500)
        assert(Object.keys(mediatype.extensions).length > 500)
        eq('application/octet-stream', mediatype.default)
    })

    it('should have method: get()', function () {
        eq('text/plain', mediatype.get('txt'))
        eq('text/plain', mediatype.get('TXT'))
        eq('application/octet-stream', mediatype.get('ninjacy'))
        eq('foo/bar', mediatype.get('ninjacy', 'foo/bar'))
    })

    it('should have method: lookup()', function () {
        eq('text/plain', mediatype.lookup('file.txt'))
        eq('text/plain', mediatype.lookup('FILE.TXT'))<commit_msg>New and improved<commit_after>var assert = require('assert'),
    mediatype = require('../mediatype')

function eq(a, b) { assert.strictEqual(a, b) }

describe('mediatype', function () {
    it('should have useful defaults', function () {
        assert(Object.keys(mediatype.types).length > 500)
        assert(Object.keys(mediatype.extensions).length > 500)
        eq('application/octet-stream', mediatype.default)
    })

    it('should have method: get()', function () {
        eq('text/plain', mediatype.get('txt'))
        eq('text/plain', mediatype.get('TXT'))
        eq('application/octet-stream', mediatype.get('ninjacy'))
        eq('foo/bar', mediatype.get('ninjacy', 'foo/bar'))
        // new and improved
        eq('application/font-woff', mediatype.get('woff'))
        eq('application/octet-stream', mediatype.get('buffer'))
        eq('audio/mp4', mediatype.get('m4a'))
        eq('font/opentype', mediatype.get('otf'))
    })

    it('should have method: lookup()', function () {
        eq('text/plain', mediatype.lookup('file.txt'))
        eq('text/plain', mediatype.lookup('FILE.TXT'))
{'fraction_non_alphanumeric': 0.1876267748478702, 'fraction_numerical': 0.007099391480730223, 'mean_word_length': 3.413870246085011, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6148604', 'n_tokens_mistral': 644, 'n_tokens_neox': 619, 'n_words': 104}