import {ComponentFixture, TestBed} from '@angular/core/testing'; import {VersionComponent} from './version.component'; import packageInfo from '../../../package.json'; describe('VersionComponent', () => { let component: VersionComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [VersionComponent] }) .compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(VersionComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create the component', () => { expect(component).toBeTruthy(); }); it('should contain the correct version', () => { // when executing the test, we're always running with the dev environment expect(component.VERSION).toEqual(`${packageInfo.version} (development build)`); }); it('should have the correct value for the "production" property', () => { // when executing the test, we're always running with the dev environment expect(component.PROD).toBeFalsy(); }); });