Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

failing last element tests

  • Loading branch information...
commit f969cd8ac8f8413746be06cad6e2ce35c58be161 1 parent 0d2e130
@substack authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/last.js
View
16 test/last.js
@@ -0,0 +1,16 @@
+var pathway = require('../');
+var test = require('tap').test;
+
+test('last element string', function (t) {
+ var rows = [ { location: 'Oakland, CA' }, { location: 'Portland, OR' } ];
+ var xs = pathway(rows, [ true, 'location', 'Oakland, CA' ]);
+ t.deepEqual(xs, [ { location: 'Oakland, CA' } ]);
+ t.end();
+});
+
+test('last element regexp', function (t) {
+ var rows = [ { location: 'Oakland, CA' }, { location: 'Portland, OR' } ];
+ var xs = pathway(rows, [ true, 'location', /\boakland\b/i ]);
+ t.deepEqual(xs, [ { location: 'Oakland, CA' } ]);
+ t.end();
+});
Please sign in to comment.
Something went wrong with that request. Please try again.