|
@@ -0,0 +1,18 @@
|
|
|
+import extract from '../extract';
|
|
|
+
|
|
|
+export default test => {
|
|
|
+ test.ok(typeof extract === 'function', 'extract should be a function');
|
|
|
+
|
|
|
+ const input = {
|
|
|
+ a: 1,
|
|
|
+ b: 2,
|
|
|
+ c: 3
|
|
|
+ };
|
|
|
+
|
|
|
+ const extracted = extract('a', 'c')(input);
|
|
|
+ test.ok(extracted.hasOwnProperty('a'), 'result should have property "a"');
|
|
|
+ test.ok(extracted.hasOwnProperty('c'), 'result should have property "c"');
|
|
|
+ test.ok(!extracted.hasOwnProperty('b'), 'result should not have property "b"');
|
|
|
+
|
|
|
+ test.done();
|
|
|
+};
|