assert-needle

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i assert-needle

Weekly Downloads

2

Version

1.0.0

License

GPL-3.0-or-later

Unpacked Size

40.9 kB

Total Files

6

Last publish

Collaborators

  • jimmiehansson