Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

feat: add padded-test-blocks #75

Merged
merged 1 commit into from
Aug 30, 2019
Merged

feat: add padded-test-blocks #75

merged 1 commit into from
Aug 30, 2019

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Aug 21, 2019

Closes: #65

@wincent
Copy link
Contributor Author

wincent commented Aug 21, 2019

Haven't tested this in liferay-portal yet, but it passes the small test suite that you can see in this PR.

Will probably want to share the logic here with the "no-it-should" rule, which currently just checks it() calls but could/should also check it.only(), it.skip() etc. (Although note, we have another lint that bans it.only(), but I imagine it should be compatible.)

@wincent
Copy link
Contributor Author

wincent commented Aug 30, 2019

Tested this on liferay-portal itself; it finds three issues and autofixes them like this:

diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleBuilder/RuleBuilder.es.js b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleBuilder/RuleBuilder.es.js
index 76ac6e0d84fe..080418f7f72b 100644
--- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleBuilder/RuleBuilder.es.js
+++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleBuilder/RuleBuilder.es.js
@@ -203,6 +203,7 @@ describe('RuleBuilder', () => {
 
 		component = new RuleBuilder(baseConfig);
 	});
+
 	afterEach(() => {
 		const addbutton = document.querySelector('#addFieldButton');
 
@@ -212,6 +213,7 @@ describe('RuleBuilder', () => {
 
 		dom.exitDocument(addbutton);
 	});
+
 	it('renders the list of rules when mode is set to view', () => {
 		component.setState({mode: 'view'});
 
diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleList/RuleList.es.js b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleList/RuleList.es.js
index 28aaecd18e94..2086f455044f 100644
--- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleList/RuleList.es.js
+++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-builder/test/js/components/RuleList/RuleList.es.js
@@ -78,6 +78,7 @@ describe('RuleList', () => {
 	beforeEach(() => {
 		jest.useFakeTimers();
 	});
+
 	afterEach(() => {
 		if (component) {
 			component.dispose();

@wincent wincent merged commit bf04c63 into master Aug 30, 2019
@wincent wincent deleted the wincent/padded-test-blocks branch August 30, 2019 11:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce blank line between it() and describe() blocks
1 participant