Skip to content
Merged
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
20 changes: 10 additions & 10 deletions test/core/compile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe("compile function", () => {
`${COMPILE_OPTIONS_ERROR}: The value of the property "${DISALLOWED_TAGS}" must be an array`
);
e(
``,
`throws an error when the same binding target is used multiple times`,
() =>
compile(
createTestObj2(
Expand All @@ -193,12 +193,12 @@ describe("compile function", () => {
`${REQUEST_COMPONENT_ERROR}: Duplicate binding target value "customTarget"`
);
e(
``,
`throws an error when bind value is not a string or object`,
() => compile(createTestObj2(`{{#r src="/api/test" bind=1}}{{/r}}`)),
`${REQUEST_COMPONENT_ERROR}: The "${BIND}" value must be a string or an object`
);
e(
``,
`throws an error when bind object contains unexpected properties`,
() =>
compile(
createTestObj2(
Expand All @@ -208,20 +208,20 @@ describe("compile function", () => {
`${REQUEST_COMPONENT_ERROR}: Unexpected property "a"`
);
e(
``,
`throws an error when bind object is empty`,
() => compile(createTestObj2(`{{#r src="/api/test" bind={} }}{{/r}}`)),
`${REQUEST_COMPONENT_ERROR}: The "${BIND_TARGET}" property is missing`
);
e(
``,
`throws an error when bind target property is not a string`,
() =>
compile(
createTestObj2(`{{#r src="/api/test" bind={ target:1 } }}{{/r}}`)
),
`${REQUEST_COMPONENT_ERROR}: The "${BIND_TARGET}" property should be a string`
);
e(
``,
`throws an error when bind prefix property is not a string`,
() =>
compile(
createTestObj2(
Expand All @@ -231,23 +231,23 @@ describe("compile function", () => {
`${REQUEST_COMPONENT_ERROR}: The "${BIND_PREFIX}" property should be a string`
);
e(
``,
`throws a render error when binding target is not defined in template`,
() =>
compile(
createTestObj2(`{{#r src="/api/test" bind="customTarget"}}{{/r}}`)
)(),
`${RENDER_ERROR}: Binding target "customTarget" not found`
);
e(
``,
`throws an error when binding target string contains spaces`,
() =>
compile(
createTestObj2(`{{#r src="/api/test" bind="custom Target"}}{{/r}}`)
)(),
`${REQUEST_COMPONENT_ERROR}: The binding target "custom Target" must not contain spaces`
);
e(
``,
`throws an error when binding target object property contains spaces`,
() =>
compile(
createTestObj2(
Expand All @@ -257,7 +257,7 @@ describe("compile function", () => {
`${REQUEST_COMPONENT_ERROR}: The binding target "custom Target" must not contain spaces`
);
e(
``,
`throws a render error when binding source request is not found`,
() =>
compile(
createTestObj2(
Expand Down
Loading