Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const apiCheck = new ApiCheck('homepage-api-check-1', {

const skipSslApiCheck = new ApiCheck('ssl-api-check-1', {
name: 'Skip SSL Check',
activated: false,
alertChannels: [slackChannel, webhookChannel],
degradedResponseTime: 10000,
maxResponseTime: 20000,
Expand Down
12 changes: 10 additions & 2 deletions packages/cli/e2e/__tests__/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ describe('test', { timeout: 45000 }, () => {

it('Test project should run successfully', async () => {
const secretEnv = uuid.v4()
const result = await runTest(fixt, ['-e', `SECRET_ENV=${secretEnv}`, '--verbose'])
const result = await runTest(fixt, [
'-e',
`SECRET_ENV=${secretEnv}`,
'--verbose',
'--grep',
'^(?!Skip SSL Check$).*',
])
expect(result.stdout).not.toContain('File extension type example')
expect(result.stdout).toContain(secretEnv)
}, 130_000)
Expand Down Expand Up @@ -98,7 +104,9 @@ describe('test', { timeout: 45000 }, () => {
} catch {
// No-op
}
const result = await runTest(fixt, ['--record', '--reporter', 'github'], {
// Keep this reporter test scoped to one stable check. The GitHub assertions below do not
// need the whole fixture project, and unrelated remote checks can make this fail first.
const result = await runTest(fixt, ['secret.check.ts', '--record', '--reporter', 'github'], {
env: {
CHECKLY_REPORTER_GITHUB_OUTPUT: reportFilename,
},
Expand Down
28 changes: 28 additions & 0 deletions packages/cli/src/constructs/__tests__/api-check.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,34 @@ describe('ApiCheck', () => {
}))
}, DEFAULT_TEST_TIMEOUT)

it('should synthesize skipSSL requests', async () => {
const output = await parseProject(
fixt,
'--config',
fixt.abspath('test-cases/test-skip-ssl/checkly.config.js'),
)

expect(output).toEqual(expect.objectContaining({
diagnostics: expect.objectContaining({
fatal: false,
}),
payload: expect.objectContaining({
resources: expect.arrayContaining([
expect.objectContaining({
logicalId: 'check',
type: 'check',
member: true,
payload: expect.objectContaining({
request: expect.objectContaining({
skipSSL: true,
}),
}),
}),
]),
}),
}))
}, DEFAULT_TEST_TIMEOUT)

describe('retryStrategy', () => {
it('should synthesize `onlyOn`', async () => {
const output = await parseProject(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'checkly'

const config = defineConfig({
projectName: 'Check Fixture',
logicalId: 'check-fixture',
checks: {
checkMatch: '**/*.check.js',
},
})

export default config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ApiCheck } from 'checkly/constructs'

new ApiCheck('check', {
name: 'Skip SSL Check',
request: {
method: 'GET',
// This fixture is parsed and synthesized only; it must never perform a network request.
url: 'https://self-signed.example.test',
skipSSL: true,
},
})
Loading