Merge pull request #392 from tzfrs/master
Improve error message when packaging an extension with an unchanged README.md
This commit is contained in:
commit
a154e8ce27
2 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue