mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-31 04:45:18 +00:00
test(config-protection): missing protected target before an existing one
This commit is contained in:
1 parent
ed2f02dd06
commit
fbb9d34fd1
1 file changed
+13
@@ -494,6 +494,19 @@ function runTests() {
|
||||
});
|
||||
assert.strictEqual(mixed.code, 2, 'mixed ordinary/config batch should be blocked: ' + mixed.stderr);
|
||||
assert.ok(mixed.stderr.includes('BLOCKED: Modifying .eslintrc.json is not allowed.'), mixed.stderr);
|
||||
|
||||
const missingThenExisting = runHook({
|
||||
tool_name: 'MultiEdit',
|
||||
tool_input: {
|
||||
file_path: path.join(tmpDir, 'missing', 'ruff.toml'),
|
||||
edits: [
|
||||
{ old_string: '', new_string: '[lint]' },
|
||||
{ file_path: eslintrc, old_string: '{}', new_string: '{ }' }
|
||||
]
|
||||
}
|
||||
});
|
||||
assert.strictEqual(missingThenExisting.code, 2, 'existing config after a missing one should be blocked: ' + missingThenExisting.stderr);
|
||||
assert.ok(missingThenExisting.stderr.includes('BLOCKED: Modifying .eslintrc.json is not allowed.'), missingThenExisting.stderr);
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user