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:
Sonu Kapoor 2020-02-27 23:36:12 -05:00 committed by atscott
parent 746e313a76
commit 0a5a841994
2 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,9 @@ module.exports = function (config) {
require('@angular-devkit/build-angular/plugins/karma'),
{'reporter:jasmine-seed': ['type', JasmineSeedReporter]},
],
proxies: {
'/dummy/image': 'src/assets/images/logos/angular/angular.png',
},
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
jasmine: {

View File

@ -88,7 +88,7 @@ describe('AnnouncementBarComponent', () => {
describe('rendering', () => {
beforeEach(() => {
component.announcement = {
imageUrl: 'link/to/image',
imageUrl: 'dummy/image',
linkUrl: 'link/to/website',
message: 'this is an <b>important</b> message',
endDate: '2018-03-01',
@ -102,7 +102,7 @@ describe('AnnouncementBarComponent', () => {
});
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', () => {