Files
Speedtest-Tracker/conf/site/node_modules/famulus/tests/objectInterface.test.js
Henry Whitaker 7d0681e77b Updated to v1.5.2
2020-06-17 18:33:53 +01:00

20 lines
697 B
JavaScript
Vendored

import test from 'ava';
import objectInterface from './../objectInterface';
const result = {body: "Hello world!", count: 1, sender: "Vasyl Stokolosa", isRead: false, created: 1531119600000};
test('module should be a function', t => {
t.is(typeof objectInterface, 'function');
});
test('should return object based on interface configuration', t => {
let email = objectInterface([
'body', 'count/1', 'sender|this.firstName + " " + this.lastName', 'created: Date.parse("Tue Jul 09 2018 17 GMT-0700")', 'isRead: false'
]);
t.deepEqual(email({
body: 'Hello world!', count: '', firstName: 'Vasyl', lastName: 'Stokolosa', another: ''
}), result
);
});