diff --git a/components/icon/__tests__/index.test.tsx b/components/icon/__tests__/index.test.tsx
index 39ba0b6f42..5591465534 100644
--- a/components/icon/__tests__/index.test.tsx
+++ b/components/icon/__tests__/index.test.tsx
@@ -4,7 +4,7 @@ import { render } from '../../../tests/utils';
// v3 兼容性测试
describe('Icon', () => {
- it('should render Icon', () => {
+ it('should not render Icon', () => {
const { container } = render();
expect(container.firstChild).toBe(null);
});
diff --git a/components/icon/__tests__/logo.svg b/components/icon/__tests__/logo.svg
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.ts.snap
similarity index 100%
rename from tests/__snapshots__/index.test.js.snap
rename to tests/__snapshots__/index.test.ts.snap
diff --git a/tests/index.test.js b/tests/index.test.ts
similarity index 91%
rename from tests/index.test.js
rename to tests/index.test.ts
index 3b9a594e00..0c347db3ee 100644
--- a/tests/index.test.js
+++ b/tests/index.test.ts
@@ -2,6 +2,8 @@ import pkg from '../package.json';
const testDist = process.env.LIB_DIR === 'dist';
+type AnyStyleObject = Record;
+
describe('antd dist files', () => {
// https://github.com/ant-design/ant-design/issues/1638
// https://github.com/ant-design/ant-design/issues/1968
@@ -35,22 +37,22 @@ describe('antd dist files', () => {
const { getThemeVariables } = require('../dist/theme');
/* eslint-enable global-require,import/no-unresolved */
- const expectThemeWithoutDark = theme => {
+ const expectThemeWithoutDark = (theme: AnyStyleObject) => {
expect(theme['blue-3']).toBe("color(~`colorPalette('@{blue-6}', 3) `)");
expect(theme['body-background']).toBe('#fff');
};
- const expectDarkTheme = theme => {
+ const expectDarkTheme = (theme: AnyStyleObject) => {
expect(theme['blue-3']).toBe('mix(@blue-base, @component-background, 30%)');
expect(theme['body-background']).toBe('@black');
};
- const expectThemeWithoutCompact = theme => {
+ const expectThemeWithoutCompact = (theme: AnyStyleObject) => {
expect(theme['padding-lg']).toBe('24px');
expect(theme['padding-md']).toBe('16px');
};
- const expectCompactTheme = theme => {
+ const expectCompactTheme = (theme: AnyStyleObject) => {
expect(theme['padding-lg']).toBe('16px');
expect(theme['padding-md']).toBe('8px');
};