Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where error message would not print directive name properly #3572

Merged
Merged
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
5 changes: 1 addition & 4 deletions packages/alpinejs/src/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ export function directive(name, callback) {
return {
before(directive) {
if (!directiveHandlers[directive]) {
console.warn(
"Cannot find directive `${directive}`. "
+ "`${name}` will use the default order of execution"
);
console.warn(String.raw`Cannot find directive \`${directive}\`. \`${name}\` will use the default order of execution`);
return;
}
const pos = directiveOrder.indexOf(directive);
Expand Down
6 changes: 3 additions & 3 deletions tests/cypress/integration/directives/x-bind-style.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('style attribute object binding with CSS variable',
</div>
`,
({ get }) => {
get('div').should(haveAttribute('style', '--MyCSS-Variable: 0.25;'))
get('div').should(haveAttribute('style', '--MyCSS-Variable:0.25;'))
}
)

Expand All @@ -62,7 +62,7 @@ test('CSS custom properties are set',
</div>
`,
({ get }) => {
get('span').should(haveAttribute('style', 'color: var(--custom-prop); --custom-prop: #f00;'))
get('span').should(haveAttribute('style', 'color: var(--custom-prop); --custom-prop:#f00;'))
}
)

Expand All @@ -73,6 +73,6 @@ test('existing CSS custom properties are preserved',
</div>
`,
({ get }) => {
get('span').should(haveAttribute('style', 'color: var(--custom-prop-b); --custom-prop-a: red; --custom-prop-b: var(--custom-prop-a);'))
get('span').should(haveAttribute('style', 'color: var(--custom-prop-b); --custom-prop-a: red; --custom-prop-b:var(--custom-prop-a);'))
}
)