Skip to content

Commit

Permalink
mute console in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfriesen committed Apr 16, 2024
1 parent e743835 commit cfab68a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component, DebugElement, SimpleChanges } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DateTime } from 'luxon';

import { NgxMatTimepickerModule } from '../ngx-mat-timepicker.module';
import { NgxMatTimepickerDirective } from './ngx-mat-timepicker.directive';
import { NgxMatTimepickerComponent } from '../components/ngx-mat-timepicker/ngx-mat-timepicker.component';

import { DateTime } from 'luxon';

@Component({
template: `
Expand Down Expand Up @@ -245,7 +245,7 @@ describe('NgxMatTimepickerDirective', () => {
});

it('should set onTouch function on registerOnTouched', () => {
const spy = jest.spyOn(console, 'log');
const spy = jest.spyOn(console, 'log').mockImplementation(() => null);

directive.registerOnTouched(console.log);
directive.onTouched();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('NgxMatTimepickerService', () => {
const locale = 'en-US';
const min = NgxMatTimepickerAdapter.parseTime('11:00 pm', { locale });
const max = NgxMatTimepickerAdapter.parseTime('11:50 pm', { locale });
const spy = jest.spyOn(console, 'error');
const spy = jest.spyOn(console, 'error').mockImplementation(() => null);

timepickerService.setDefaultTimeIfAvailable(
'11:43 pm',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { fixDateTimeUnit } from './datetime-unit-fix.utils';

describe('fixDateTimeUnit', () => {
it('should fix unit', () => {
jest.spyOn(console, 'warn').mockImplementation(() => null);

expect(fixDateTimeUnit('hours')).toBe('hour');
expect(fixDateTimeUnit('minutes')).toBe('minute');

Expand Down

0 comments on commit cfab68a

Please sign in to comment.