<commit_before>/*global describe it beforeEach*/
import { expect } from 'chai';
import { Schedule, normalize } from '../../src/model/hours';

describe( 'normalize', function() {
  it( 'should return an HHMM string', function() {
    const date = new Date();
    date.setHours( 6 );
    date.setMinutes( 30 );

    const result = normalize( date );
    expect( result ).to.equal( '1970-01-01T11:30:00.000Z' );
  } );
} );
describe( 'Schedule', function() {
  beforeEach( function() {
    this.opens = new Date();
    this.opens.setUTCHours( 10 );
    this.opens.setMinutes( 30 );

    this.closes = new Date();
    this.closes.setUTCHours( 18 );
    this.closes.setMinutes( 30 );
  } );
  describe( 'constructor()', function() {
    it( 'should initialize the schedule object', function() {
      const schedule = new Schedule();
      expect( schedule ).to.have.deep.property( 'attributes.schedule' );
    } );
  } );
  describe( 'addHoursIn()', function() {
    it( 'should add hours in the default season', function() {
      const schedule = new Schedule();
      schedule.addHoursIn( 'monday', this.opens, this.closes );
      expect( schedule.attributes )
        .to.have.deep.property( 'schedule.default[0]' )
        .with.deep.property( 'day', 'monday' );
      expect( schedule.attributes )
        .to.have.deep.property( 'schedule.default[0]' )
        .with.deep.property( 'opens', '1970-01-01T11:30:00.000Z' );
    } );
    it( 'should add hours to a named season', function() {
      const schedule = new Schedule();
      schedule.addHoursIn( 'monday', this.opens, this.closes, 'winter' );<commit_msg>Tests depended on timzeone of test runner<commit_after>/*global describe it beforeEach*/
import { expect } from 'chai';
import { Schedule, normalize } from '../../src/model/hours';

describe( 'normalize', function() {
  it( 'should return an HHMM string', function() {
    const date = new Date();
    date.setHours( 11 );
    date.setMinutes( 30 );

    const result = normalize( date );

    date.setYear( 1970 );
    date.setMonth( 0 );
    date.setDate( 1 );
    date.setSeconds( 0 );
    date.setMilliseconds( 0 );

    expect( result ).to.equal( date.toISOString() );
  } );
} );
describe( 'Schedule', function() {
  beforeEach( function() {
    this.opens = new Date();
    this.opens.setHours( 11 );
    this.opens.setMinutes( 30 );

    this.closes = new Date();
    this.closes.setHours( 18 );
    this.closes.setMinutes( 30 );
  } );
  describe( 'constructor()', function() {
    it( 'should initialize the schedule object', function() {
      const schedule = new Schedule();
      expect( schedule ).to.have.deep.property( 'attributes.schedule' );
    } );
  } );
  describe( 'addHoursIn()', function() {
    it( 'should add hours in the default season', function() {
      const schedule = new Schedule();
      schedule.addHoursIn( 'monday', this.opens, this.closes );
      expect( schedule.attributes )
        .to.have.deep.property( 'schedule.default[0]' )
        .with.deep.property( 'day', 'monday' );
      expect( schedule.attributes )
        .to.have.deep.property( 'schedule.default[0]' )
        .with.deep.property( 'opens' )
        .that.is.a( 'string' );
    } );
    it( 'should add hours to a named season', function() {
      const schedule = new Schedule();
      schedule.addHoursIn( 'monday', this.opens, this.closes, 'winter' );
{'fraction_non_alphanumeric': 0.16400709219858156, 'fraction_numerical': 0.020390070921985817, 'mean_word_length': 2.9870435806831566, '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': '767148', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1051, 'n_words': 273}