Merge pull request #392 from tzfrs/master

Improve error message when packaging an extension with an unchanged README.md
This commit is contained in:
João Moreno 2019-10-11 06:11:47 -07:00 committed by GitHub
commit a154e8ce27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -328,7 +328,7 @@ export class MarkdownProcessor extends BaseProcessor {
let contents = await read(file);
if (/This is the README for your extension /.test(contents)) {
throw new Error(`Make sure to edit the README.md file before you publish your extension.`);
throw new Error(`Make sure to edit the README.md file before you package or publish your extension.`);
}
const markdownPathRegex = /(!?)\[([^\]\[]*|!\[[^\]\[]*]\([^\)]+\))\]\(([^\)]+)\)/g;

View file

@ -1594,4 +1594,13 @@ describe('MarkdownProcessor', () => {
await throws(() => processor.onFile(readme));
});
it('should catch an unchanged README.md', async () => {
const manifest = { name: 'test', publisher: 'mocha', version: '0.0.1', engines: Object.create(null), repository: 'https://github.com/username/repository' };
const contents = `This is the README for your extension `;
const processor = new ReadmeProcessor(manifest, {});
const readme = { path: 'extension/readme.md', contents };
await throws(() => processor.onFile(readme));
})
});