Skip to content
Permalink
Browse files

Add bundle tests

  • Loading branch information...
kgryte committed Oct 14, 2019
1 parent a933770 commit b1271e215013e7aae373e55719d552bc7982bbbb
Showing with 61 additions and 0 deletions.
  1. +61 −0 test/test.dist.js
@@ -75,6 +75,15 @@ tape( 'project contains a distributable file containing emoji datasets (minified
t.end();
});

tape( 'project contains a distributable file containing the FiveThirtyEight FFQ dataset (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-datasets-fivethirtyeight-ffq.min.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.FIVETHIRTYEIGHT_FFQ, 'function', 'is a function' );
t.equal( typeof bundle.FIVETHIRTYEIGHT_FFQ(), 'object', 'returns expected value' ); // eslint-disable-line new-cap
t.end();
});

tape( 'project contains a distributable file containing images (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-datasets-img.min.js' ) );
@@ -156,6 +165,40 @@ tape( 'project contains a distributable file containing "flat" namespace help te
t.end();
});

tape( 'project contains a distributable file containing plotting functions (unminified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-plot-flat.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.plot, 'function', 'has member' );
t.end();
});

tape( 'project contains a distributable file containing plotting functions (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-plot-flat.min.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.plot, 'function', 'has member' );
t.end();
});

tape( 'project contains a distributable file containing base special mathematical functions (unminified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-math-base-special-flat.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.base, 'object', 'has member' );
t.equal( bundle.base.sin( 3.14 ), 0.0015926529164868282, 'returns expected value' );
t.end();
});

tape( 'project contains a distributable file containing base special mathematical functions (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-math-base-special-flat.min.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.base, 'object', 'has member' );
t.equal( bundle.base.sin( 3.14 ), 0.0015926529164868282, 'returns expected value' );
t.end();
});

tape( 'project contains a distributable file for REPL functionality (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-repl.min.js' ) );
@@ -164,6 +207,24 @@ tape( 'project contains a distributable file for REPL functionality (minified)',
t.end();
});

tape( 'project contains a distributable file containing base statistical distribution functions (unminified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-stats-base-dists-flat.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.base, 'object', 'has member' );
t.equal( typeof bundle.base.dists.normal.pdf( 0.5, 0.0, 1.0 ), 'number', 'returns expected value' );
t.end();
});

tape( 'project contains a distributable file containing base statistical distribution functions (minified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-stats-base-dists-flat.min.js' ) );
t.equal( typeof bundle, 'object', 'main export is an object' );
t.equal( typeof bundle.base, 'object', 'has member' );
t.equal( typeof bundle.base.dists.normal.pdf( 0.5, 0.0, 1.0 ), 'number', 'returns expected value' );
t.end();
});

tape( 'project contains a distributable file exposing a "tree" namespace (unminified)', function test( t ) {
// eslint-disable-next-line stdlib/no-dynamic-require
var bundle = require( join( dirpath, 'stdlib-tree.js' ) );

0 comments on commit b1271e2

Please sign in to comment.
You can’t perform that action at this time.