FontAwesome: Could not find icon with iconName=plus and prefix=fas. This warning will become a hard error in 0.6.0.
See original GitHub issueI use FontAwesome into my application, that in constructor import a library:
export class CoreModule {
constructor(library: FaIconLibrary) {
library.addIconPacks(fas);
}
}
when i do test with angular testing library
import {render} from '@testing-library/angular';
import {screen} from '@testing-library/dom';
import {DialogWrapperComponent} from './dialog-wrapper.component';
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
import {FaIconLibrary, FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {fas} from '@fortawesome/free-solid-svg-icons';
import {SharedModule} from '../shared.module';
import {CoreModule} from '../../core/core.module';
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {TestBed} from '@angular/core/testing';
describe('first test', () => {
test('first input test', async () => {
TestBed.configureTestingModule({
schemas: [NO_ERRORS_SCHEMA],
imports: [FontAwesomeModule],
}).compileComponents();
const close = jest.fn();
const {click} = await render(DialogWrapperComponent, {
declarations: [],
imports: [
FontAwesomeModule,
],
providers: [
NgbModal,
],
componentProperties: {
title: 'hello',
--> iconColorPair: {icon: 'plus', color: 'black'},
modalClose: {
emit: close,
} as any
},
});
const title = screen.getByText('hello');
const iconClose = screen.getByTestId('btn-close');
--> const icon = screen.getByText('fas, file');
click(iconClose);
expect(close).toHaveBeenCalledTimes(1);
});
});
the test write this message FontAwesome: Could not find icon with iconName=plus and prefix=fas. This warning will become a hard error in 0.6.0.
Someone can help me? please
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Font Awesome 5: Could not find icon money-check
Look at the icon's page: it was added in 5.0.13 - and you seem to be using 5.1.0-8. user-check is from 5.1.0.11.
Read more >Help and Troubleshooting | Font Awesome Docs
You can find tips and support for desktop issues in Troubleshooting on the Desktop. The icon I want to use is missing or...
Read more >@fortawesome/angular-fontawesome - npm
Start using @fortawesome/angular-fontawesome in your project by running ... TypeScript icon, indicating that this package has built-in type ...
Read more >How To Use Font Awesome icons in Angular Applications
If you get the above error that means you are using older version of angular fontawesome icons. Then use the legacy icon library...
Read more >Font Awesome icons in Vue.js apps: A complete guide
In this tutorial, learn to add those icons to your Vue.js app. ... wish to try the online demo, see below, but be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ok i resolve!! i create a new
module
only for the icon a then import this into my rendermethod
@georgy-alarcon Thank you!