This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
714 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/app/components/form-radio/form-radio.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FormRadioComponent } from './form-radio.component'; | ||
import { ReactiveFormsModule, FormsModule } from '@angular/forms'; | ||
import { APP_BASE_HREF } from '@angular/common'; | ||
|
||
|
||
describe('FormRadioComponent', () => { | ||
let component: FormRadioComponent; | ||
let fixture: ComponentFixture<FormRadioComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
FormsModule, | ||
ReactiveFormsModule | ||
], | ||
declarations: [FormRadioComponent], | ||
providers: [ | ||
{ provide: APP_BASE_HREF, useValue: '/' } | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FormRadioComponent); | ||
component = fixture.componentInstance; | ||
component.field = { "type": "text", "label": "Explain", "name": "testName", "hidden": true, "required": true }; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Error.stackTraceLimit = 5; | ||
|
||
import 'core-js/es6/symbol'; | ||
import 'core-js/es6/object'; | ||
import 'core-js/es6/function'; | ||
import 'core-js/es6/parse-int'; | ||
import 'core-js/es6/parse-float'; | ||
import 'core-js/es6/number'; | ||
import 'core-js/es6/math'; | ||
import 'core-js/es6/string'; | ||
import 'core-js/es6/date'; | ||
import 'core-js/es6/array'; | ||
import 'core-js/es6/regexp'; | ||
import 'core-js/es6/map'; | ||
import 'core-js/es6/weak-map'; | ||
import 'core-js/es6/set'; | ||
|
||
import 'core-js/es6/reflect'; | ||
import 'core-js/es7/reflect'; | ||
|
||
import 'zone.js/dist/zone' | ||
|
||
import 'zone.js/dist/long-stack-trace-zone'; | ||
import 'zone.js/dist/proxy.js'; | ||
import 'zone.js/dist/sync-test'; | ||
import 'zone.js/dist/jasmine-patch'; | ||
import 'zone.js/dist/async-test'; | ||
import 'zone.js/dist/fake-async-test'; | ||
|
||
import { getTestBed } from '@angular/core/testing' | ||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing' | ||
|
||
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. | ||
declare const __karma__: any; | ||
declare const require: any; | ||
|
||
// Prevent Karma from running prematurely. | ||
__karma__.loaded = function () { | ||
}; | ||
|
||
// First, initialize the Angular testing environment. | ||
getTestBed().initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting() | ||
); | ||
|
||
// Then we find all the tests. | ||
const context = require.context('../src', true, /spec$/i); | ||
// And load the modules. | ||
context.keys().map(context); | ||
// Finally, start Karma to run the tests. | ||
__karma__.start(); |
Oops, something went wrong.