Reputation: 316
Let's say I write a Jest test case as:
test('encode bar', () => {
let foo = encodeBar();
expect(foo).toEqual("bar");
});
and then run it as:
node node_modules/.bin/jest --no-coverage -t "encode bar"
It works fine.
However if I add a '+' sign to my test case string as:
test('encode + bar', () => {
let foo = encodeBar();
expect(foo).toEqual("bar");
});
and then run it as:
node node_modules/.bin/jest --no-coverage -t "encode + bar"
Jest will fail to run the test. Is this documented/configurable somewhere?
Upvotes: 0
Views: 163
Reputation: 146
-t
(--testNamePattern) expects regex, escape +
with backslash like this: -t "encode \+ bar"
Upvotes: 1