Skip to content

assert: stringMatching method

Rodrigo Muino Tomonari requested to merge github/fork/jy95/util-method into master
Checklist
  • make -j4 test (UNIX), or vcbuild 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\.*/]);

Merge request reports

Loading