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

chore(jest): add typeahead for watch mode #12467

Merged
merged 4 commits into from Apr 3, 2020
Merged

chore(jest): add typeahead for watch mode #12467

merged 4 commits into from Apr 3, 2020

Conversation

silviuaavram
Copy link
Contributor

@silviuaavram silviuaavram commented Mar 30, 2020

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

Adds https://github.com/jest-community/jest-watch-typeahead to our jest config.
You now have autocomplete/typeahead functionality when you use filtering by file name or by test name in your yarn test:watch.

Focus areas to test

(optional)

Microsoft Reviewers: Open in CodeFlow

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Mar 30, 2020

Perf Analysis

No significant results to display.

All results

Scenario Master Ticks PR Ticks Status
BaseButton 773 728
BaseButton (experiments) 870 863
ChoiceGroup 4943 4911
DefaultButton 953 963
DefaultButton (experiments) 1742 1779
DetailsRow 3109 3175
DetailsRow (fast icons) 3197 3045
DetailsRow without styles 2891 2944
DocumentCardTitle with truncation 1549 1543
MenuButton 1285 1269
MenuButton (experiments) 3353 3339
PrimaryButton 1117 1098
PrimaryButton (experiments) 1819 1874
SplitButton 2811 2913
SplitButton (experiments) 6567 6671
Stack 439 434
Stack with Intrinsic children 1020 1053
Stack with Text children 3702 3722
Text 351 331
Toggle 790 795
Toggle (experiments) 2128 2120
button 60 60

Perf Analysis (Fluent)

Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.56 0.48 1.17:1 2000 1119
🦄 Button.Fluent 0.1 0.18 0.56:1 5000 498
🔧 Checkbox.Fluent 0.77 0.41 1.88:1 1000 772
🔧 Dialog.Fluent 0.39 0.19 2.05:1 5000 1928
🔧 Dropdown.Fluent 3.68 0.45 8.18:1 1000 3682
🔧 Icon.Fluent 0.17 0.05 3.4:1 5000 850
🎯 Image.Fluent 0.07 0.1 0.7:1 5000 358
🔧 Slider.Fluent 1.63 0.39 4.18:1 1000 1627
🔧 Text.Fluent 0.08 0.02 4:1 5000 418
🦄 Tooltip.Fluent 0.12 16.25 0.01:1 5000 616

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
ListNestedPerf.default 1023 959 1.07:1
Text.Fluent 418 389 1.07:1
VideoMinimalPerf.default 884 832 1.06:1
LabelMinimalPerf.default 412 396 1.04:1
AttachmentSlotsPerf.default 3815 3706 1.03:1
ButtonMinimalPerf.default 155 150 1.03:1
ListCommonPerf.default 1062 1033 1.03:1
RefMinimalPerf.default 199 194 1.03:1
TreeWith60ListItems.default 238 230 1.03:1
Avatar.Fluent 1119 1091 1.03:1
AvatarMinimalPerf.default 591 577 1.02:1
CarouselMinimalPerf.default 656 641 1.02:1
DialogMinimalPerf.default 1975 1928 1.02:1
ItemLayoutMinimalPerf.default 2112 2076 1.02:1
MenuMinimalPerf.default 2067 2028 1.02:1
PopupMinimalPerf.default 258 254 1.02:1
PortalMinimalPerf.default 313 306 1.02:1
Button.Fluent 498 489 1.02:1
Checkbox.Fluent 772 754 1.02:1
ChatMinimalPerf.default 610 604 1.01:1
DropdownMinimalPerf.default 3724 3689 1.01:1
ImageMinimalPerf.default 360 357 1.01:1
InputMinimalPerf.default 1103 1088 1.01:1
LayoutMinimalPerf.default 660 652 1.01:1
ListWith60ListItems.default 1253 1241 1.01:1
ProviderMergeThemesPerf.default 1473 1463 1.01:1
ProviderMinimalPerf.default 677 669 1.01:1
ReactionMinimalPerf.default 2565 2544 1.01:1
TableMinimalPerf.default 661 652 1.01:1
Dropdown.Fluent 3682 3639 1.01:1
Image.Fluent 358 354 1.01:1
Slider.Fluent 1627 1608 1.01:1
AlertMinimalPerf.default 608 610 1:1
AttachmentMinimalPerf.default 962 960 1:1
ChatWithPopoverPerf.default 618 620 1:1
DropdownManyItemsPerf.default 1521 1518 1:1
FormMinimalPerf.default 931 929 1:1
GridMinimalPerf.default 857 857 1:1
HierarchicalTreeMinimalPerf.default 1024 1021 1:1
RadioGroupMinimalPerf.default 547 545 1:1
StatusMinimalPerf.default 665 662 1:1
TextAreaMinimalPerf.default 3228 3243 1:1
CustomToolbarPrototype.default 3871 3854 1:1
ToolbarMinimalPerf.default 1143 1145 1:1
TreeMinimalPerf.default 1180 1185 1:1
CheckboxMinimalPerf.default 3311 3348 0.99:1
EmbedMinimalPerf.default 5602 5653 0.99:1
LoaderMinimalPerf.default 1124 1132 0.99:1
MenuButtonMinimalPerf.default 1540 1549 0.99:1
SliderMinimalPerf.default 1594 1615 0.99:1
SplitButtonMinimalPerf.default 3593 3619 0.99:1
Tooltip.Fluent 616 621 0.99:1
AnimationMinimalPerf.default 648 662 0.98:1
DividerMinimalPerf.default 971 989 0.98:1
HeaderMinimalPerf.default 542 551 0.98:1
HeaderSlotsPerf.default 1635 1666 0.98:1
SegmentMinimalPerf.default 1073 1099 0.98:1
TooltipMinimalPerf.default 884 898 0.98:1
Dialog.Fluent 1928 1968 0.98:1
Icon.Fluent 850 869 0.98:1
AccordionMinimalPerf.default 230 238 0.97:1
CardMinimalPerf.default 372 382 0.97:1
ChatDuplicateMessagesPerf.default 429 441 0.97:1
BoxMinimalPerf.default 365 379 0.96:1
TextMinimalPerf.default 398 413 0.96:1
FlexMinimalPerf.default 293 308 0.95:1
IconMinimalPerf.default 430 455 0.95:1
ListMinimalPerf.default 442 465 0.95:1
ButtonSlotsPerf.default 628 669 0.94:1

@size-auditor
Copy link

size-auditor bot commented Mar 30, 2020

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 16345e00d8e3ff4071793da22ee52b5a8e49ccb3 (build)

Copy link
Contributor

@kolaps33 kolaps33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe please if you could add some usage example? :) (how to use it, what everything is possible to do with this plugin)
Or if the whole functionality is auto suggest then of course this comment is not relevant :)

@@ -12,4 +12,5 @@ module.exports = {
'test/(.*)$': `<rootDir>/test/$1`,
},
setupFilesAfterEnv: [...commonConfig.setupFilesAfterEnv, './test/setup.ts'],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to shared config

@@ -38,6 +38,7 @@
"@types/simulant": "^0.2.0",
"@uifabric/build": "^7.0.0",
"faker": "^4.1.0",
"jest-watch-typeahead": "^0.4.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenotron or @ecraig12345 should this just go in the scripts/package.json file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so

@dzearing
Copy link
Member

It'd be great if we could add to jest-resources.js as well, and the scripts/package.json devDependencies.

I'd love for there to be one standard config really, but that might be outside the scope here.

@ecraig12345
Copy link
Member

Yes, standardizing on one config is definitely out of scope for this PR.

@khmakoto khmakoto added the Fluent UI react-northstar (v0) Work related to Fluent UI V0 label Mar 31, 2020
@silviuaavram
Copy link
Contributor Author

@ecraig12345 @dzearing I pushed latest change, moved the devDependency to the scripts/package.json.

@silviuaavram silviuaavram merged commit a411b1b into microsoft:master Apr 3, 2020
@silviuaavram silviuaavram deleted the chore/jest-watch-typeahead branch April 3, 2020 13:11
DuanShaolong pushed a commit to DuanShaolong/fluentui that referenced this pull request Apr 27, 2020
* add package and configure jest

* add watch plugin to main jest config

* move devDepend to scripts package.json

* add to watchPlugins to jest-resources as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fluent UI react-northstar (v0) Work related to Fluent UI V0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants