<commit_before>import 'es6-shim';
import 'reflect-metadata';
import * as moment from 'moment';
import {FromUnixPipe} from './FromUnixPipe';
import {DateFormatPipe} from './DateFormatPipe';

describe('FromUnixPipe', () => {
  describe('#transform', () => {
    it('should parse a unix timestamp number to moment', () => {
      const pipe = new FromUnixPipe();
      const result = pipe.transform(1456263980);
      expect(result).toEqual(moment.unix(1456263980));
    });

    it('should parse a unix timestamp string to moment', () => {
      const pipe = new FromUnixPipe();
      const result = pipe.transform('1456263980');
      expect(result).toEqual(moment.unix(1456263980));
    });

    it('should format a unix timestamp', () => {
	  const unixPipe = new FromUnixPipe(),
            datePipe = new DateFormatPipe();
	  const result = datePipe.transform(unixPipe.transform(1456263980), ['hh:mmA']);
      expect(result).toBe('01:46PM');
    });
  });
});<commit_msg>fix(FromUnixPipe.spec): unit test locale issue<commit_after>import 'es6-shim';
import 'reflect-metadata';
import * as moment from 'moment';
import {FromUnixPipe} from './FromUnixPipe';
import {DateFormatPipe} from './DateFormatPipe';

describe('FromUnixPipe', () => {
  describe('#transform', () => {
    it('should parse a unix timestamp number to moment', () => {
      const pipe = new FromUnixPipe();
      const result = pipe.transform(1456263980);
      expect(result).toEqual(moment.unix(1456263980));
    });

    it('should parse a unix timestamp string to moment', () => {
      const pipe = new FromUnixPipe();
      const result = pipe.transform('1456263980');
      expect(result).toEqual(moment.unix(1456263980));
    });

    it('should format a unix timestamp', () => {
	  const unixPipe = new FromUnixPipe(),
            datePipe = new DateFormatPipe();
	  const result = datePipe.transform(unixPipe.transform(1456263980), ['hh:mmA']);
      expect(result.length).toEqual(7);
    });
  });
});
{'fraction_non_alphanumeric': 0.16120906801007556, 'fraction_numerical': 0.05390428211586902, 'mean_word_length': 3.8557457212713935, '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': '5680264', 'n_tokens_mistral': 695, 'n_tokens_neox': 637, 'n_words': 140}