<commit_before>import test from 'tape';
import SchemaDefinition, { SCHEMA_KEY } from '../src/SchemaDefinition';
import * as messageTypes from '../src/messageTypes';

const define = new SchemaDefinition();

test('SchemaDefinition', (t) => {
  t.ok(define instanceof SchemaDefinition, 'should be able to instantiate');
  t.end();
});

test('SchemaDefinition define#type', (t) => {
  t.throws(() => {
    define.type('Something not supported');
  }, /is not supported/, 'should throw when trying to declare an unsupported type');
  define.type(Number);
  t.assert(define[SCHEMA_KEY].type === Number, 'should be able to define "type"');
  t.assert(define.definitions.filter((d) => d === 'type')[0], 'should have "type" defined in definitions');
  t.throws(() => {
    define.type(Number);<commit_msg>added tests<commit_after>import test from 'tape';
import SchemaDefinition, { SCHEMA_KEY } from '../src/SchemaDefinition';

const define = new SchemaDefinition();

test('SchemaDefinition', (t) => {
  t.ok(define instanceof SchemaDefinition, 'should be able to instantiate');
  t.end();
});

test('SchemaDefinition define#type', (t) => {
  t.throws(() => {
    define.type('Something not supported');
  }, /is not supported/, 'should throw when trying to declare an unsupported type');
  define.type(Number);
  t.assert(define[SCHEMA_KEY].type === Number, 'should be able to define "type"');
  t.assert(define.definitions.filter((d) => d === 'type')[0], 'should have "type" defined in definitions');
  t.throws(() => {
    define.type(Number);
{'fraction_non_alphanumeric': 0.1730644111906311, 'fraction_numerical': 0.0013012361743656475, 'mean_word_length': 4.961240310077519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5499880', 'n_tokens_mistral': 459, 'n_tokens_neox': 454, 'n_words': 131}