* Expect that the workspace has a README.md file, and that it is a non-empty * string. The README.md is expected to: * * - Not contain template instructions (unless the workspace is the module * template itself). * - Match the version of Node.js specified in the `.nvmrc` file. * * @param {Wor
(workspace, workspaceName)
| 138 | * @returns {Promise<void>} |
| 139 | */ |
| 140 | async function expectReadme(workspace, workspaceName) { |
| 141 | const readme = await getWorkspaceFile(workspace, 'README.md'); |
| 142 | if ( |
| 143 | workspaceName !== 'metamask-module-template' && |
| 144 | readme.includes('## Template Instructions') |
| 145 | ) { |
| 146 | workspace.error( |
| 147 | 'The README.md contains template instructions. These instructions should be removed.', |
| 148 | ); |
| 149 | } |
| 150 | |
| 151 | if (!readme.includes(`yarn add @metamask/${workspaceName}`)) { |
| 152 | workspace.error( |
| 153 | `The README.md does not contain an example of how to install the package using Yarn (\`yarn add @metamask/${workspaceName}\`). Please add an example.`, |
| 154 | ); |
| 155 | } |
| 156 | |
| 157 | if (!readme.includes(`npm install @metamask/${workspaceName}`)) { |
| 158 | workspace.error( |
| 159 | `The README.md does not contain an example of how to install the package using npm (\`npm install @metamask/${workspaceName}\`). Please add an example.`, |
| 160 | ); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Expect that the workspace has a pull_request_template.md file, and that it |
no test coverage detected
searching dependent graphs…