|
1 | | -import { readFileSync, readdirSync } from 'node:fs'; |
| 1 | +import { readFileSync } from 'node:fs'; |
2 | 2 | import { fileURLToPath } from 'node:url'; |
3 | 3 | import { createDevServer } from 'devframe/adapters/dev'; |
4 | 4 | import { afterEach, describe, expect, it, vi } from 'vitest'; |
@@ -252,23 +252,12 @@ describe('pangular dev MCP route', () => { |
252 | 252 | describe('shared-state filter source', () => { |
253 | 253 | const repo = fileURLToPath(new URL('../../../../', import.meta.url)); |
254 | 254 |
|
255 | | - // The filter must come from published devframe, not from `patches/`, which |
256 | | - // apply only inside this repository: an app that installs the package would |
257 | | - // otherwise get every key again (issue #238). |
258 | | - it('needs no local patch', () => { |
259 | | - for (const file of readdirSync(`${repo}patches`)) { |
260 | | - const lines = readFileSync(`${repo}patches/${file}`, 'utf8').split('\n'); |
261 | | - // A line a hunk only touches (to add a comma) is removed and added again. |
262 | | - const removed = new Set( |
263 | | - lines |
264 | | - .filter((line) => /^-(?!--)/.test(line)) |
265 | | - .map((line) => line.slice(1).replace(/,$/, '')), |
266 | | - ); |
267 | | - const added = lines |
268 | | - .filter((line) => /^\+(?!\+\+)/.test(line)) |
269 | | - .filter((line) => !removed.has(line.slice(1).replace(/,$/, ''))); |
270 | | - expect(added.join('\n'), file).not.toContain('exposeSharedState'); |
271 | | - } |
| 255 | + // The route options must come from published devframe, not from pnpm |
| 256 | + // patches, which apply only inside this repository: an app that installs |
| 257 | + // the package would otherwise miss them (issues #238 and #428). |
| 258 | + it('needs no local patch of devframe', () => { |
| 259 | + const workspace = readFileSync(`${repo}pnpm-workspace.yaml`, 'utf8'); |
| 260 | + expect(workspace).not.toMatch(/^\s*'?(?:devframe|@devframes\/[\w-]+)@[^:]*'?:\s*patches\//m); |
272 | 261 | }); |
273 | 262 |
|
274 | 263 | it('requires a devframe release that has the route option', () => { |
|
0 commit comments