test(docs-infra): add proxy to fake images in tests (#35741)
Previously, when running the unit tests for aio on Windows, many 404s are logged for images, resulting in progress logs being spread over multiple lines. This commit fixes this by adding a `proxy` to point the fake image to a real image within the `src` folder. Closes #29775 PR Close #35741
This commit is contained in:
parent
746e313a76
commit
0a5a841994
|
@ -14,6 +14,9 @@ module.exports = function (config) {
|
||||||
require('@angular-devkit/build-angular/plugins/karma'),
|
require('@angular-devkit/build-angular/plugins/karma'),
|
||||||
{'reporter:jasmine-seed': ['type', JasmineSeedReporter]},
|
{'reporter:jasmine-seed': ['type', JasmineSeedReporter]},
|
||||||
],
|
],
|
||||||
|
proxies: {
|
||||||
|
'/dummy/image': 'src/assets/images/logos/angular/angular.png',
|
||||||
|
},
|
||||||
client: {
|
client: {
|
||||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||||
jasmine: {
|
jasmine: {
|
||||||
|
|
|
@ -88,7 +88,7 @@ describe('AnnouncementBarComponent', () => {
|
||||||
describe('rendering', () => {
|
describe('rendering', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.announcement = {
|
component.announcement = {
|
||||||
imageUrl: 'link/to/image',
|
imageUrl: 'dummy/image',
|
||||||
linkUrl: 'link/to/website',
|
linkUrl: 'link/to/website',
|
||||||
message: 'this is an <b>important</b> message',
|
message: 'this is an <b>important</b> message',
|
||||||
endDate: '2018-03-01',
|
endDate: '2018-03-01',
|
||||||
|
@ -102,7 +102,7 @@ describe('AnnouncementBarComponent', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display an image', () => {
|
it('should display an image', () => {
|
||||||
expect(element.querySelector('img')!.src).toContain('link/to/image');
|
expect(element.querySelector('img')!.src).toContain('dummy/image');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a link', () => {
|
it('should display a link', () => {
|
||||||
|
|
Loading…
Reference in New Issue