assert: stringMatching method
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Description
Verify that requested constraints match the provided input :
const assert = require('assert');
// default case : check if string(s) match criterias
// should be false
assert.stringMatching('blublu', ['blublu', 'blu']);
// advanced case : check that strings matches regex
// should be true
assert.stringMatching(['blublu', 'blu'], /blu\.*/);
// or to mix both of them ^^
// should be false
assert.stringMatching(['blublu', 'lol'], ['blublu', /blu\.*/]);