Skip to content

Commit bea92f9

Browse files
committed
fix: update tests for improved error messages and pin Node.js 20 for Vercel
- Update NotFoundError test to expect the new actionable hint suffix - Update BasePlugin validation test to expect human-readable messages - Pin Node.js 20 in docs/vercel.json to avoid ESM resolution issues on Node 24
1 parent fe96cee commit bea92f9

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/vercel.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"framework": null,
33
"buildCommand": "npx @raystack/chronicle@0.5.2 build --preset=vercel --content=.",
4-
"installCommand": "echo 'skip'"
4+
"installCommand": "echo 'skip'",
5+
"nodeVersion": "20"
56
}

plugins/base_plugin_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func TestBasePluginValidate(t *testing.T) {
6868

6969
assert.Equal(t, err, plugins.InvalidConfigError{
7070
Errors: []plugins.ConfigError{
71-
{Key: "field_a", Message: "validation for field 'field_a' failed on the 'required' tag"},
72-
{Key: "field_b", Message: "validation for field 'field_b' failed on the 'url' tag"},
73-
{Key: "nested.field_c", Message: "validation for field 'nested.field_c' failed on the 'required' tag"},
71+
{Key: "field_a", Message: "field 'field_a' is required"},
72+
{Key: "field_b", Message: "field 'field_b' must be a valid URL (e.g. https://example.com), got \"\""},
73+
{Key: "nested.field_c", Message: "field 'nested.field_c' is required"},
7474
},
7575
})
7676
})

plugins/errors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func TestNotFoundError(t *testing.T) {
8181
Type: "extractor",
8282
Name: "testplugin",
8383
},
84-
expected: "could not find extractor \"testplugin\"",
84+
expected: "could not find extractor \"testplugin\"\n Run 'meteor plugins list --type extractor' to see available plugins.",
8585
},
8686
}
8787
for _, tt := range tests {

0 commit comments

Comments
 (0)