2023-01-14 19:30:26 +08:00
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const blogList = [
|
|
|
|
'check-conduct',
|
2023-07-05 17:47:58 +08:00
|
|
|
'contributor-development-maintenance-guide',
|
2023-01-14 19:30:26 +08:00
|
|
|
'css-in-js',
|
2023-07-05 17:47:58 +08:00
|
|
|
'extract-ssr',
|
2023-01-14 19:30:26 +08:00
|
|
|
'getContainer',
|
2023-07-05 17:47:58 +08:00
|
|
|
'github-actions-workflow',
|
|
|
|
'issue-helper',
|
|
|
|
'mock-project-build',
|
2023-01-14 19:30:26 +08:00
|
|
|
'modal-hook-order',
|
|
|
|
'testing-migrate',
|
2023-07-05 17:47:58 +08:00
|
|
|
'render-times',
|
2023-01-14 19:30:26 +08:00
|
|
|
'to-be-collaborator',
|
2023-07-05 17:47:58 +08:00
|
|
|
'tooltip-align',
|
|
|
|
'tree-shaking',
|
|
|
|
'why-not-static',
|
2023-01-14 19:30:26 +08:00
|
|
|
].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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|