We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a98fc3 commit 20f425bCopy full SHA for 20f425b
1 file changed
test/content.spec.js
@@ -1,6 +1,7 @@
1
import path from "node:path";
2
import core from "@actions/core";
3
import { assert } from "chai";
4
+import { YAMLException } from "js-yaml";
5
import Config from "../src/config.js";
6
import Content from "../src/content.js";
7
import SlackError from "../src/errors.js";
@@ -190,6 +191,11 @@ describe("content", () => {
190
191
err.message,
192
"Invalid input! Failed to parse contents of the provided payload",
193
);
194
+ assert.isDefined(err.cause?.values);
195
+ assert.equal(err.cause.values.length, 2);
196
+ const [jsonError, yamlError] = err.cause.values;
197
+ assert.isTrue(jsonError instanceof SyntaxError);
198
+ assert.isTrue(yamlError instanceof YAMLException);
199
} else {
200
assert.fail("Failed to throw a SlackError", err);
201
}
0 commit comments