You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
683 B
28 lines
683 B
2 years ago
|
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);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
});
|