<commit_before>import { assert, expect } from 'meteor/practicalmeteor:chai';
import { Planner } from '../planner/planner';
import { createPlanner,
         removePlanner,
         getPlannerIDs } from '../planner/methods';
import { insertNewSemesterInPlanner } from '../semester/methods';
import { insertOneModuleInSemester,
         getAllModulesInSemester,
         getOneModuleInSemester,
         deleteOneModuleInSemester } from './methods';
import  { insertOneModuleInSemester,
          getAllModulesInSemester,
          getOneModuleInSemester,
          deleteOneModuleInSemester } from './meteor-methods';

describe('modules', function () {
  const userID = 'akshhr31lci1lkal';
  const modules = ['CS1010', 'CS1020', 'CS2010', 'CS3230'];

  beforeEach(function ()  {
    const plannerNames = ['plannerOne'];
    const focusArea = [
      ['Computer Graphics And Games',
       'Parallel Computing'],
    ];
    const academicYear = ['AY14/15', 'AY14/15', 'AY15/16', 'AY15/16', 'AY16/17', 'AY16/17', 'AY17/18', 'AY17/18'];
    const semesterNum = [1, 2, 1, 2, 1, 2, 1, 2];
    const semesterIndex = [];
    const plannerIDOne = createPlanner(plannerNames[0], focusArea[0], userID);

    for (var i=0; i < semesterNum.length; i++)  {
      semesterIndex.push(insertNewSemesterInPlanner(academicYear[i], semesterNum[i], plannerIDOne));
    }

    for (var i = 0; i< semesterIndex.length; i++) {
      for (var j = 0; j < modules.length; j++)  {
        insertOneModuleInSemester(i, modules[j], plannerIDOne);
      }
    }<commit_msg>REMOVE extra duplicated functions in modules<commit_after>import { assert, expect } from 'meteor/practicalmeteor:chai';
import { Planner } from '../planner/planner';
import { createPlanner,
         removePlanner,
         getPlannerIDs } from '../planner/methods';
import { insertNewSemesterInPlanner } from '../semester/methods';
import { insertOneModuleInSemester,
         getAllModulesInSemester,
         getOneModuleInSemester,
         deleteOneModuleInSemester } from './methods';

describe('modules', function () {
  const userID = 'akshhr31lci1lkal';
  const modules = ['CS1010', 'CS1020', 'CS2010', 'CS3230'];

  beforeEach(function ()  {
    const plannerNames = ['plannerOne'];
    const focusArea = [
      ['Computer Graphics And Games',
       'Parallel Computing'],
    ];
    const academicYear = ['AY14/15', 'AY14/15', 'AY15/16', 'AY15/16', 'AY16/17', 'AY16/17', 'AY17/18', 'AY17/18'];
    const semesterNum = [1, 2, 1, 2, 1, 2, 1, 2];
    const semesterIndex = [];
    const plannerIDOne = createPlanner(plannerNames[0], focusArea[0], userID);

    for (var i=0; i < semesterNum.length; i++)  {
      semesterIndex.push(insertNewSemesterInPlanner(academicYear[i], semesterNum[i], plannerIDOne));
    }

    for (var i = 0; i< semesterIndex.length; i++) {
      for (var j = 0; j < modules.length; j++)  {
        insertOneModuleInSemester(i, modules[j], plannerIDOne);
      }
    }
{'fraction_non_alphanumeric': 0.14639945652173914, 'fraction_numerical': 0.043478260869565216, 'mean_word_length': 3.4824961948249618, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1555789', 'n_tokens_mistral': 1060, 'n_tokens_neox': 959, 'n_words': 216}