Skip to content

jimmiehansson/assert-needle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A small helper to find matching needles against strings in assertions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published