add test
This commit is contained in:
		@@ -40,3 +40,14 @@ test ('copy object', (t) => {
 | 
			
		||||
  t.is (copy.foo, 'baz');
 | 
			
		||||
  t.is (obj.foo, 'bar');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test ('run regex', (t) => {
 | 
			
		||||
  const data = 'foobarfoo';
 | 
			
		||||
  const regex = /foo/gu;
 | 
			
		||||
  let count = 0;
 | 
			
		||||
  util.run_regex(regex,data,(res)=>{
 | 
			
		||||
    t.is(res[0], 'foo');
 | 
			
		||||
    count++;
 | 
			
		||||
  })
 | 
			
		||||
  t.is(count, 2);
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user