From a87a725c3044c60365cfbb109902dc82bdff159b Mon Sep 17 00:00:00 2001 From: Theodoros Tzaferis Date: Fri, 11 Oct 2019 13:57:38 +0200 Subject: [PATCH 1/2] Improve error message when packaging an extension with an unchanged README.md --- src/package.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.ts b/src/package.ts index e93479fb..7167f3ed 100644 --- a/src/package.ts +++ b/src/package.ts @@ -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; From 4903798070577cd2725d11efdf8c9d5f004355ad Mon Sep 17 00:00:00 2001 From: Theodoros Tzaferis Date: Fri, 11 Oct 2019 13:58:02 +0200 Subject: [PATCH 2/2] Add test for catching unchanged README.md --- src/test/package.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/package.test.ts b/src/test/package.test.ts index ecc07f0a..bb144a9c 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -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)); + }) });