qunit
qunit copied to clipboard
Let simple array data in test.each() serve as automatic labels
Follows-up https://github.com/qunitjs/qunit/issues/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'
);
} );
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]
.