brijmcq
provides great insight on how to fix the issue. I have also struggled with correctly loading css for fonts (that also load font files), in my case material icons:
The css file loads the font files and failed during testing
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(MaterialIcons-Regular.woff2) format('woff2'),
url(MaterialIcons-Regular.woff) format('woff'),
url(MaterialIcons-Regular.ttf) format('truetype');
}
This can be overcome by instructing Jasmine to also serve those files:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
files: [
"node_modules/bootstrap/dist/css/bootstrap.css",
"node_modules/material-design-icons/iconfont/material-icons.css",
"node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
{
pattern: 'node_modules/material-design-icons/iconfont/*',
watched: false,
included: false,
served: true,
nocache: false
}
],