Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Better clarify arrowType warning
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Oct 14, 2019
1 parent b358552 commit a8506cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ export function validateProps(
prop === 'arrowType',
`The \`arrowType\` prop was removed in v5 in favor of overloading the
\`arrow\` prop.
"round" string was replaced with importing the string from the package.
* import {roundArrow} from 'tippy.js'; (ESM version)
* const {roundArrow} = tippy; (IIFE CDN version)
Before: {arrow: true, arrowType: "round"}
After: {arrow: "round"}`,
After: {arrow: roundArrow}`,
);

warnWhen(
Expand Down
13 changes: 9 additions & 4 deletions test/unit/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ describe('validateProps', () => {
expect(spy).toHaveBeenCalledWith(
...getFormattedMessage(
`The \`arrowType\` prop was removed in v5 in favor of overloading the
\`arrow\` prop.
Before: {arrow: true, arrowType: "round"}
After: {arrow: "round"}`,
\`arrow\` prop.
"round" string was replaced with importing the string from the package.
* import {roundArrow} from 'tippy.js'; (ESM version)
* const {roundArrow} = tippy; (IIFE CDN version)
Before: {arrow: true, arrowType: "round"}
After: {arrow: roundArrow}`,
),
);
});
Expand Down

0 comments on commit a8506cd

Please sign in to comment.