'use strict';

// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var minard = require( './../lib/minard.js' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.strictEqual( typeof minard, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function throws an error if unable to load data', function test( t ) {
	var minard = proxyquire( './../lib/minard.js', {
		'@stdlib/fs/read-json': {
			'sync': readJSON
		}
	});
	t.throws( minard, Error, 'throws an error' );
	t.end();

	function readJSON() {
		return new Error( 'unable to read data' );
	}
});

@@ -386,16 +386,29 @@
 oad data
+ (no options)
 ', funct
@@ -659,12 +659,399 @@
 ' );%0A%09%7D%0A%7D);%0A
+%0Atape( 'the function throws an error if unable to load data (options)', function test( t ) %7B%0A%09var minard = proxyquire( './../lib/minard.js', %7B%0A%09%09'@stdlib/fs/read-json': %7B%0A%09%09%09'sync': readJSON%0A%09%09%7D%0A%09%7D);%0A%09t.throws( foo, Error, 'throws an error' );%0A%09t.end();%0A%0A%09function foo() %7B%0A%09%09minard(%7B%0A%09%09%09'data': 'army'%0A%09%09%7D);%0A%09%7D%0A%0A%09function readJSON() %7B%0A%09%09return new Error( 'unable to read data' );%0A%09%7D%0A%7D);%0A

Add test