Skip to content

Commit

Permalink
chore: add sslCheckDomain property [sc-0] (#112)
Browse files Browse the repository at this point in the history
* chore: add sslCheckDomain property [sc-0]

* fix: remove sslCheckDomain omitempty [sc-0]

* fix: ignore SSLCheckDomain field for tests [sc-0]
  • Loading branch information
Nahuel Alejandro Ramos committed Aug 8, 2023
1 parent 0fc4e29 commit 89ed52b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
5 changes: 4 additions & 1 deletion checkly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var wantCheck = checkly.Check{
"foo",
"bar",
},
SSLCheckDomain: "example.com",
LocalSetupScript: "setitup",
LocalTearDownScript: "tearitdown",
AlertSettings: checkly.AlertSettings{
Expand Down Expand Up @@ -144,7 +145,9 @@ func validateEmptyBody(t *testing.T, body []byte) {
func validateAnything(*testing.T, []byte) {
}

var ignoreCheckFields = cmpopts.IgnoreFields(checkly.Check{}, "ID", "AlertChannelSubscriptions", "FrequencyOffset", "AlertSettings.SSLCertificates", "PrivateLocations")
// TODO: adjust wantCheck to test multiple SSLCheckDomain value and remove it from this list
var ignoreCheckFields = cmpopts.IgnoreFields(checkly.Check{}, "ID", "AlertChannelSubscriptions", "FrequencyOffset",
"AlertSettings.SSLCertificates", "PrivateLocations", "SSLCheckDomain")

func TestAPIError(t *testing.T) {
t.Parallel()
Expand Down
21 changes: 11 additions & 10 deletions demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ var apiCheck = checkly.Check{
}

var browserCheck = checkly.Check{
Name: "My Browser Check",
Type: checkly.TypeBrowser,
Frequency: 10,
Activated: true,
Muted: false,
ShouldFail: false,
DoubleCheck: false,
SSLCheck: true,
Locations: []string{"eu-west-1"},
AlertSettings: alertSettings,
Name: "My Browser Check",
Type: checkly.TypeBrowser,
Frequency: 10,
Activated: true,
Muted: false,
ShouldFail: false,
DoubleCheck: false,
SSLCheck: true,
SSLCheckDomain: "www.acme.com",
Locations: []string{"eu-west-1"},
AlertSettings: alertSettings,
Script: `const assert = require("chai").assert;
const puppeteer = require("puppeteer");
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ type Check struct {
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"`
DoubleCheck bool `json:"doubleCheck"`
Tags []string `json:"tags,omitempty"`
SSLCheckDomain string `json:"sslCheckDomain"`
SetupSnippetID int64 `json:"setupSnippetId,omitempty"`
TearDownSnippetID int64 `json:"tearDownSnippetId,omitempty"`
LocalSetupScript string `json:"localSetupScript,omitempty"`
Expand Down

0 comments on commit 89ed52b

Please sign in to comment.