@jaxolotl/wdclib
Version:
Required Library to bridge javascript with Tableau. Use the scripts below to create the combined shim library. i.e. npm run-script build_and_copy
47 lines (31 loc) • 1.02 kB
JavaScript
/* eslint-env node, mocha, jest */
import { copyFunctions, linkObjectProperties } from './Utilities';
describe('UNIT - Utilities', () => {
it('copyFunctions to copy functions from source to target', () => {
let source = {
a: function a () {
}
};
let target = {};
copyFunctions(source, target);
expect(target.a).toBe(source.a);
});
it('linkObjectProperties to change the values from target to source', () => {
let source = {
a: function a () {
},
x: 5,
y: 'this is why'
};
let target = {
y: 'there\'no why'
};
linkObjectProperties(source, target, ['x', 'y']);
expect(target.x).toBe(source.x);
expect(target.y).toBe(source.y);
let y = 'I wonder why';
target.y = y;
expect(target.y).toBe(source.y);
expect(target.y).toBe(y);
});
});