Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"prepare:ai-context": "cross-env CHECKLY_SKIP_AUTH=1 CHECKLY_CLI_VERSION=99.0.0 ./bin/run import plan --root gen --debug-import-plan-input-file ./src/ai-context/context.fixtures.json && jiti ./scripts/prepare-ai-context.ts",
"prepare:dist": "tsc --build",
"prepare": "pnpm run clean && pnpm run prepare:dist && pnpm run prepare:ai-context",
"test": "pnpm pack && vitest --run",
"test": "pnpm pack && pnpm run test:types && vitest --run",
"test:types": "tsc -p tsconfig.type-tests.json --noEmit",
"test:e2e": "pnpm pack && cross-env NODE_CONFIG_DIR=./e2e/config vitest --run -c ./vitest.config.e2e.mts",
"test:e2e:local": "cross-env CHECKLY_BASE_URL=http://localhost:3000 CHECKLY_ENV=local pnpm run test:e2e",
"watch": "tsc --watch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ describe('AgenticCheckCodegen', () => {
expect(source).not.toContain('RetryStrategyBuilder')
})

it('should not emit intent because AgenticCheck does not support it', async () => {
const source = await renderResource(env, baseResource({
intent: {
goal: 'Backend data that must not be exposed on this construct.',
},
}))

expect(source).not.toContain('intent:')
})

it('should not emit `agentRuntime` when `agenticCheckData` is missing', async () => {
const source = await renderResource(env, baseResource())
expect(source).not.toContain('agentRuntime')
Expand Down
38 changes: 38 additions & 0 deletions packages/cli/src/constructs/__tests__/api-check.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,44 @@ describe('ApiCheck', () => {
}))
}, DEFAULT_TEST_TIMEOUT)

it('should synthesize normalized intent from a packed fixture project', async () => {
const output = await parseProject(
fixt,
'--config',
fixt.abspath('test-cases/test-intent/checkly.config.js'),
)

expect(output).toEqual(expect.objectContaining({
diagnostics: expect.objectContaining({
fatal: false,
}),
payload: expect.objectContaining({
resources: expect.arrayContaining([
expect.objectContaining({
logicalId: 'dashboard-intent',
type: 'check',
member: true,
payload: expect.objectContaining({
intent: {
goal: 'Verify that authenticated users can open the dashboard.',
constraints: [
{
type: 'REQUIRED_OUTCOME',
statement: 'The dashboard displays the account overview.',
},
{
type: 'MUST_PRESERVE',
statement: 'Do not weaken the authentication assertion.',
},
],
},
}),
}),
]),
}),
}))
}, DEFAULT_TEST_TIMEOUT)

it('should not synthesize default runtime', async () => {
const output = await parseProject(
fixt,
Expand Down
Loading
Loading