<commit_before>import { TestBed, inject } from '@angular/core/testing';
import { HttpModule } from '@angular/http';

import { TaskService } from './task.service';
import { HttpClient } from '../common/HttpClient';
import { TokenStorage } from '../common/TokenStorage';

describe('TaskService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [ HttpModule ],
      providers: [TaskService, HttpClient, TokenStorage]
    });
  });

  it('should ...', inject([TaskService], (service: TaskService) => {
    expect(service).toBeTruthy();
  }));
});<commit_msg>add it<commit_after>import { TestBed, inject } from '@angular/core/testing';
import { HttpModule } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';

import { TaskService } from './task.service';
import { HttpClient } from '../common/HttpClient';
import { TokenStorage } from '../common/TokenStorage';
import { Task } from './Task';

describe('TaskService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [ HttpModule ],
      providers: [TaskService, HttpClient, TokenStorage]
    });
  });

  it('should ...', inject([TaskService], (service: TaskService) => {
    expect(service).toBeTruthy();
  }));

  it('should get task list', inject([TaskService], (service: TaskService) => {
    const tasks: Task[] = [];
    for (let i = 0; i < 5; i++) {
      tasks.push(
        Task.create({
          id: i,
          title: `title_${i}`,
          description: `description_${i}`,
          due_date: new Date(2017, 2, 1)
        })
      );
    }
    spyOn(service, 'list').and.returnValue(Observable.of(tasks));

    const result = service.list();
    result.subscribe(subscribe => {
      expect(subscribe.length).toEqual(5);
    });
  }));
});
{'fraction_non_alphanumeric': 0.18326912493120529, 'fraction_numerical': 0.0049532195927352776, 'mean_word_length': 3.3807228915662653, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 11, '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': '2479831', 'n_tokens_mistral': 551, 'n_tokens_neox': 542, 'n_words': 118}