import test from 'tape'
import ChunkifyOptions from './options'


test('should throw when receiving non-object literal options', t => {
  let WRONG_TYPES = [
    false,
    true,
    null,
    undefined,
    [],
    function() {}
  ];
  for (let thing of WRONG_TYPES) {
    t.throws(() => {
      ChunkifyOptions.of(thing)
    }, new RegExp(`Expected options object, got ${typeof thing}`))
  }
  t.end()
});

test('should have defaults', t => {
  let options = ChunkifyOptions.of({});
  t.equals(typeof options.complete, 'function');
  t.equals(typeof options.delay, 'number');
  t.equals(typeof options.chunk, 'number');
  t.end()
});

test.skip('should override defaults', t => {

});

test.skip('should throw when an option override has the wrong type', t => {

});

test.skip('should be read-only', t => {

});






@@ -626,24 +626,323 @@
 .end()%0A%7D);%0A%0A
+test('should override all defaults', t =%3E %7B%0A  let chunk = 50;%0A  let delay = 100;%0A  let complete = function() %7B%7D;%0A%0A  let options = ChunkifyOptions.of(%7Bchunk, delay, complete%7D);%0A  t.equals(options.chunk, chunk);%0A  t.equals(options.delay, delay);%0A  t.equals(options.complete, complete);%0A  t.end()%0A%7D);%0A%0A
 test.skip('s
@@ -956,16 +956,21 @@
 verride 
+some 
 defaults
@@ -971,33 +971,32 @@
 faults', t =%3E %7B%0A
-%0A
 %7D);%0A%0Atest.skip('

Test overrides all defaults