diff --git a/components/icon/__tests__/index.test.js b/components/icon/__tests__/index.test.js
index 5a2469de2a..43eb7beb1f 100644
--- a/components/icon/__tests__/index.test.js
+++ b/components/icon/__tests__/index.test.js
@@ -227,23 +227,23 @@ describe('utils', () => {
]);
});
- it('should depracate typo icon name', () => {
+ it('should report an error when there are deprecated typos in icon names', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render();
expect(errorSpy).toHaveBeenLastCalledWith(
- "Warning: [antd: Icon] Icon 'interation' is typo and depracated, please use 'interaction' instead.",
+ "Warning: [antd: Icon] Icon 'interation' was a typo and is now deprecated, please use 'interaction' instead.",
);
render();
expect(errorSpy).toHaveBeenLastCalledWith(
- "Warning: [antd: Icon] Icon 'cross' is typo and depracated, please use 'close' instead.",
+ "Warning: [antd: Icon] Icon 'cross' was a typo and is now deprecated, please use 'close' instead.",
);
render();
expect(errorSpy).toHaveBeenLastCalledWith(
- "Warning: [antd: Icon] Icon 'canlendar' is typo and depracated, please use 'calendar' instead.",
+ "Warning: [antd: Icon] Icon 'canlendar' was a typo and is now deprecated, please use 'calendar' instead.",
);
render();
expect(errorSpy).toHaveBeenLastCalledWith(
- "Warning: [antd: Icon] Icon 'colum-height' is typo and depracated, please use 'column-height' instead.",
+ "Warning: [antd: Icon] Icon 'colum-height' was a typo and is now deprecated, please use 'column-height' instead.",
);
expect(errorSpy).toHaveBeenCalledTimes(4);
errorSpy.mockRestore();
diff --git a/components/icon/utils.ts b/components/icon/utils.ts
index 9717a17199..275e75185f 100644
--- a/components/icon/utils.ts
+++ b/components/icon/utils.ts
@@ -72,7 +72,7 @@ export function alias(type: string) {
warning(
newType === type,
'Icon',
- `Icon '${type}' is typo and depracated, please use '${newType}' instead.`,
+ `Icon '${type}' was a typo and is now deprecated, please use '${newType}' instead.`,
);
return newType;
}