1.0.0 • Published 8 months ago

assert-needle v1.0.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
8 months ago

assert-needle

This module acts as a small helper to find matching keywords inside strings for assertions.

Install

npm i assert-needle

Example

'use strict';

const { expected } = require('assert-needle');

var str = '[1459875739796] WARN : instance.final with output does not support flushing [1459875739796] INFO  (123456 on abcdefghijklmnopqr): beforeExit';
var s$ = [
  'instance.final',
  'output',
  'beforeExit',
  '123456',
  'abcdefghijklmnopqr',
  'WARN',
  'INFO'
];

if(expected(str).output({ has: s$ })) {
    return true;
}

License

GPL-3.0

1.0.0

8 months ago