spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / policy / deny-rules-hold.test.ts
24 lines · 687 BRaw
1import { describe, expect, test, tier } from 'claude-code/testing'
2
3import Policy from '../../hooks/policy'
4import Fixtures from '../fixtures'
5
6tier('prepend')
7
8describe('deny-rules-hold', () => {
9 test('deny rules hold unless the option is the literal true', () => {
10 expect(
11 [true, 'true', 1, false, undefined].map(value =>
12 Policy.denyRulesHold(Fixtures.overridePolicyOf(value)),
13 ),
14 ).toEqual([false, true, true, true, true])
15 })
16
17 test('settings with no entry for this plugin hold them', () => {
18 expect(
19 [Fixtures.MANAGED_POLICY, {}, { pluginConfigs: 'x' }].map(
20 Policy.denyRulesHold,
21 ),
22 ).toEqual([true, true, true])
23 })
24})