@@ -157,6 +157,13 @@ function addUtcMonths(date: Date, months: number): Date {
|
157 | 157 | return next; |
158 | 158 | } |
159 | 159 | |
| 160 | +function expectNonEmptyStringList(values: readonly string[], label: string) { |
| 161 | +expect(values, label).toEqual([expect.stringMatching(/\S/u), ...values.slice(1)]); |
| 162 | +for (const value of values) { |
| 163 | +expect(value, label).toMatch(/\S/u); |
| 164 | +} |
| 165 | +} |
| 166 | + |
160 | 167 | describe("plugin compatibility registry", () => { |
161 | 168 | it("keeps compatibility codes unique and lookup-safe", () => { |
162 | 169 | const records = listPluginCompatRecords(); |
@@ -188,9 +195,9 @@ describe("plugin compatibility registry", () => {
|
188 | 195 | for (const record of listPluginCompatRecords()) { |
189 | 196 | expect(record.introduced, record.code).toMatch(datePattern); |
190 | 197 | expect(record.docsPath, record.code).toMatch(/^\//u); |
191 | | -expect(record.surfaces.length, record.code).toBeGreaterThan(0); |
192 | | -expect(record.diagnostics.length, record.code).toBeGreaterThan(0); |
193 | | -expect(record.tests.length, record.code).toBeGreaterThan(0); |
| 198 | +expectNonEmptyStringList(record.surfaces, `${record.code}: surfaces`); |
| 199 | +expectNonEmptyStringList(record.diagnostics, `${record.code}: diagnostics`); |
| 200 | +expectNonEmptyStringList(record.tests, `${record.code}: tests`); |
194 | 201 | for (const testPath of record.tests) { |
195 | 202 | expect(fs.existsSync(testPath), `${record.code}: ${testPath}`).toBe(true); |
196 | 203 | } |
|