Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
X-tee
X-Road-catalogue
Commits
9b8fd8e6
Commit
9b8fd8e6
authored
Apr 11, 2019
by
Vitali Stupin
Browse files
Changing unit tests
parent
4fe9ab3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/app-routing.module.spec.ts
View file @
9b8fd8e6
import
{
AppRoutingModule
}
from
'
./app-routing.module
'
;
describe
(
'
AppModule
'
,
()
=>
{
describe
(
'
App
Routing
Module
'
,
()
=>
{
let
module
:
AppRoutingModule
;
beforeEach
(()
=>
{
...
...
src/app/app.module.spec.ts
View file @
9b8fd8e6
...
...
@@ -2,14 +2,15 @@ import { AppModule, HttpLoaderFactory } from './app.module';
import
{
TranslateHttpLoader
}
from
'
@ngx-translate/http-loader
'
;
import
{
AppConfig
}
from
'
./app.config
'
;
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
HttpClient
}
from
'
selenium-webdriver/http
'
;
describe
(
'
AppModule
'
,
()
=>
{
let
appModule
:
AppModule
;
let
httpClientSpy
:
{
get
:
jasmine
.
Spy
};
let
appConfigSpy
:
{
load
:
jasmine
.
Spy
};
beforeEach
(()
=>
{
httpClientSpy
=
jasmine
.
createSpyObj
(
'
HttpClient
'
,
[
'
get
'
]);
appConfigSpy
=
jasmine
.
createSpyObj
(
'
HttpClient
'
,
[
'
load
'
]);
appModule
=
new
AppModule
();
});
...
...
@@ -25,9 +26,10 @@ describe('AppModule', () => {
TestBed
.
configureTestingModule
({
imports
:
[
AppModule
],
providers
:
[
{
provide
:
HttpClient
,
useValue
:
httpClient
Spy
}
{
provide
:
AppConfig
,
useValue
:
appConfig
Spy
}
]
});
expect
(
TestBed
.
get
(
AppConfig
)).
toBeTruthy
();
expect
(
appConfigSpy
.
load
).
toHaveBeenCalledTimes
(
1
);
});
});
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment