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

Let simple array data in test.each() serve as automatic labels #1733

Open
Krinkle opened this issue Nov 9, 2023 · 0 comments
Open

Let simple array data in test.each() serve as automatic labels #1733

Krinkle opened this issue Nov 9, 2023 · 0 comments
Labels
Component: Core For module, test, hooks, and runner. good first issue Is straight-forward to start with and someone can guide you help welcome Type: Enhancement

Comments

@Krinkle
Copy link
Member

Krinkle commented Nov 9, 2023

Follows-up #1568

What are you trying to do?

Code that reproduces the problem:

QUnit.test.each( 'escapeRegExp [specials]', [
	'foo',
	'bar',
	'_',
	'+',
	'-',
	'^',
	'$'
], function ( assert, str ) {
	assert.propEqual(
		str.match( new RegExp( mw.util.escapeRegExp( str ) ) ),
		[ str ],
		'confirm correct escaping by being able to match itself'
	);
} );
Screenshot

What did you expect to happen?

For simple cases like this, it would be valuable I think if we can let values serve dual-purpose as the test name suffix. In other words as:

  • mytest [foo]
  • mytest [bar]
  • mytest [_]

What actually happened?

  • mytest [0]
  • mytest [1]
  • mytest [2].
@Krinkle Krinkle added Type: Enhancement Component: Core For module, test, hooks, and runner. help welcome good first issue Is straight-forward to start with and someone can guide you labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core For module, test, hooks, and runner. good first issue Is straight-forward to start with and someone can guide you help welcome Type: Enhancement
Development

No branches or pull requests

1 participant