Skip to content

Instantly share code, notes, and snippets.

@godber
Last active July 13, 2017 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godber/47783348915c14f9a99b70f35b8cd055 to your computer and use it in GitHub Desktop.
Save godber/47783348915c14f9a99b70f35b8cd055 to your computer and use it in GitHub Desktop.
A simple spec file using the new API on the teraslice test harness
'use strict';
var processor = require('../index');
var harness = require('teraslice_op_test_harness')(processor);
describe('With data in is []', function() {
it('data out is []', function() {
expect(harness.run([])).toEqual([]);
});
});
describe('The data doubles when', function() {
it('using simple data and percentage is 100', function() {
expect(harness.run(harness.data.simple)).toEqual(harness.data.simple);
});
});
describe('The data doubles when', function() {
var opConfig = {percentage: 100};
it('using simple data and percentage is 100', function() {
var newData = [];
harness.data.simple.forEach(function(item) {
newData.push(item, item);
});
expect(harness.run(harness.data.simple, opConfig)).toEqual(newData);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment