StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/cryo/test/function.test.js

34 lines
1023 B

4 years ago
var mocha = require('mocha');
var assert = require('chai').assert;
var Cryo = require('../lib/cryo');
describe('Function', function() {
it('should hydrate a function', function() {
var original = function(from, to) {
return 'hello world from ' + from + ' to ' + to;
};
var stringified = Cryo.stringify(original);
var hydrated = Cryo.parse(stringified);
var result1 = original('Hunter', 'you');
var result2 = hydrated('Hunter', 'you');
assert.deepEqual(result1, result2);
});
it('should hydrate a function that has properties', function() {
var original = function(from, to) {
return 'hello world from ' + from + ' to ' + to;
};
original.attached = 'some property';
var stringified = Cryo.stringify(original);
var hydrated = Cryo.parse(stringified);
var result1 = original('Hunter', 'you');
var result2 = hydrated('Hunter', 'you');
assert.deepEqual(result1, result2);
assert.strictEqual(hydrated.attached, original.attached);
});
});