Skip to content

Commit

Permalink
Merge pull request #232 from brettz9/regexp-u-flags
Browse files Browse the repository at this point in the history
Add `u` flag in RegExp for `valid-test-description` and `valid-suite-description`
  • Loading branch information
lo1tuma authored Feb 17, 2020
2 parents 57add13 + 7007b33 commit 347d544
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rules/valid-suite-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const astUtils = require('../util/ast');
const defaultSuiteNames = [ 'describe', 'context', 'suite' ];

function inlineOptions(context) {
const pattern = new RegExp(context.options[0]);
const pattern = new RegExp(context.options[0], 'u');
const suiteNames = context.options[1] ? context.options[1] : defaultSuiteNames;
const message = context.options[2];

return { pattern, suiteNames, message };
}

function objectOptions(options) {
const pattern = new RegExp(options.pattern);
const pattern = new RegExp(options.pattern, 'u');
const suiteNames = options.suiteNames ? options.suiteNames : defaultSuiteNames;
const message = options.message;

Expand Down
4 changes: 2 additions & 2 deletions lib/rules/valid-test-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const astUtils = require('../util/ast');
const defaultTestNames = [ 'it', 'test', 'specify' ];

function inlineOptions(context) {
const pattern = context.options[0] ? new RegExp(context.options[0]) : /^should/;
const pattern = context.options[0] ? new RegExp(context.options[0], 'u') : /^should/u;
const testNames = context.options[1] ? context.options[1] : defaultTestNames;
const message = context.options[2];

return { pattern, testNames, message };
}

function objectOptions(options) {
const pattern = options.pattern ? new RegExp(options.pattern) : /^should/;
const pattern = options.pattern ? new RegExp(options.pattern, 'u') : /^should/u;
const testNames = options.testNames ? options.testNames : defaultTestNames;
const message = options.message;

Expand Down

0 comments on commit 347d544

Please sign in to comment.