mirror of
https://github.com/microsoft/playwright-cli.git
synced 2026-09-14 19:59:39 +08:00
test(skills): regress on skill-update notice (#429)
Add an integration test that installs skills, mutates the installed SKILL.md, and asserts the out-of-date warning is shown. Guards against the bundled-skill path resolution regressing if files move.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { spawn } from 'child_process';
|
||||
import { test, expect } from '@playwright/test';
|
||||
@@ -70,3 +71,16 @@ test('open data URL', async ({}) => {
|
||||
exitCode: 0,
|
||||
}));
|
||||
});
|
||||
|
||||
test('warns when installed skill is out of date', async ({}) => {
|
||||
expect(await runCli('install', '--skills')).toEqual(expect.objectContaining({
|
||||
exitCode: 0,
|
||||
}));
|
||||
|
||||
const skillFile = path.join(test.info().outputPath(), '.claude', 'skills', 'playwright-cli', 'SKILL.md');
|
||||
fs.appendFileSync(skillFile, 'x');
|
||||
|
||||
expect(await runCli('--help')).toEqual(expect.objectContaining({
|
||||
error: expect.stringContaining('does not match the tool version'),
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user