mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
test: add test case for en-US blog to avoid omission in translation (#40231)
This commit is contained in:
parent
df3c33c378
commit
973abb6e56
27
components/__tests__/blog.test.ts
Normal file
27
components/__tests__/blog.test.ts
Normal file
@ -0,0 +1,27 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const blogList = [
|
||||
'check-conduct',
|
||||
'css-in-js',
|
||||
'getContainer',
|
||||
'modal-hook-order',
|
||||
'render-times',
|
||||
'testing-migrate',
|
||||
'to-be-collaborator',
|
||||
].map((blogName) => path.join(__dirname, `../../docs/blog/${blogName}.en-US.md`));
|
||||
|
||||
describe('blog', () => {
|
||||
it('should not include Chinese in en-US blog', () => {
|
||||
blogList.forEach((blog) => {
|
||||
fs.readFile(blog, (err: NodeJS.ErrnoException | null, data: Buffer) => {
|
||||
if (err) {
|
||||
return;
|
||||
}
|
||||
const includeChinese = /[\u4E00-\u9FA5]/.test(data.toString());
|
||||
expect(includeChinese).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user