<commit_before>import { observable } from "mobx";
import uuidv4 from "uuid/v4";

export default class Suite {
  id = null;
  @observable name = "Untitled Suite";
  @observable tests = [];

  store = null;

  constructor(store, id = uuidv4()) {
    this.store = store;
    this.id = id;
    this.addTest = this.addTest.bind(this);
    this.removeTest = this.removeTest.bind(this);
  }

  addTest(test) {
    if (!test || test.constructor.name !== "Test") {
      throw new Error(`Expected to receive Test instead received ${test ? test.constructor.name : test}`);
    } else if (!this.store.tests.includes(test)) {
      throw new Error("The given Test does not exists in the tests pool");
    } else {
      this.tests.push(test);
    }
  }

  removeTest(test) {
    if (!test || test.constructor.name !== "Test") {
      throw new Error(`Expected to receive Test instead received ${test ? test.constructor.name : test}`);
    } else {
      this.tests.remove(test);
    }
  }<commit_msg>moved name to ctor, and removed store checks<commit_after>import { observable } from "mobx";
import uuidv4 from "uuid/v4";

export default class Suite {
  id = null;
  @observable name = null;
  @observable tests = [];

  store = null;

  constructor(id = uuidv4(), name = "Untitled Suite") {
    this.id = id;
    this.name = name;
    this.addTest = this.addTest.bind(this);
    this.removeTest = this.removeTest.bind(this);
  }

  addTest(test) {
    if (!test || test.constructor.name !== "Test") {
      throw new Error(`Expected to receive Test instead received ${test ? test.constructor.name : test}`);
    } else {
      this.tests.push(test);
    }
  }

  removeTest(test) {
    if (!test || test.constructor.name !== "Test") {
      throw new Error(`Expected to receive Test instead received ${test ? test.constructor.name : test}`);
    } else {
      this.tests.remove(test);
    }
  }
{'fraction_non_alphanumeric': 0.14588859416445624, 'fraction_numerical': 0.003183023872679045, 'mean_word_length': 3.0472103004291844, 'pattern_counts': {'":': 0, '<': 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': '2451838', 'n_tokens_mistral': 599, 'n_tokens_neox': 595, 'n_words': 161}