import { expect } from 'chai'; import { DictEntry } from './dict-entry'; import { dirs } from './dirs'; import { gatherFromMarkdownFiles, isTranslation } from './extractor'; describe('auto check translations', function () { const entries = gatherFromMarkdownFiles(dirs.content) .filter(isNotCheatSheet) .filter(isNotMarketingDocs) .filter(isNotCnPages); it('should not have in translation', function () { const codeExamples = entries.filter(entry => entry.translation.indexOf(' isTranslation(entry.original)) .filter(isNotImg); expect(lines).eql([]); }); it('should have same head level', function () { const lines = entries .filter(entry => isHead(entry.original) && isHead(entry.translation)) .filter(entry => { const originalLevel = entry.original.replace(/^(#+).*$/, '$1').length; const translationLevel = entry.translation.replace(/^(#+).*$/, '$1').length; return originalLevel !== translationLevel; }); expect(lines).eql([]); }); it('english should not be
/^ *