Skip to content

Commit b1271e2

Browse files
committed
Add bundle tests
1 parent a933770 commit b1271e2

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

test/test.dist.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ tape( 'project contains a distributable file containing emoji datasets (minified
7575
t.end();
7676
});
7777

78+
tape( 'project contains a distributable file containing the FiveThirtyEight FFQ dataset (minified)', function test( t ) {
79+
// eslint-disable-next-line stdlib/no-dynamic-require
80+
var bundle = require( join( dirpath, 'stdlib-datasets-fivethirtyeight-ffq.min.js' ) );
81+
t.equal( typeof bundle, 'object', 'main export is an object' );
82+
t.equal( typeof bundle.FIVETHIRTYEIGHT_FFQ, 'function', 'is a function' );
83+
t.equal( typeof bundle.FIVETHIRTYEIGHT_FFQ(), 'object', 'returns expected value' ); // eslint-disable-line new-cap
84+
t.end();
85+
});
86+
7887
tape( 'project contains a distributable file containing images (minified)', function test( t ) {
7988
// eslint-disable-next-line stdlib/no-dynamic-require
8089
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
156165
t.end();
157166
});
158167

168+
tape( 'project contains a distributable file containing plotting functions (unminified)', function test( t ) {
169+
// eslint-disable-next-line stdlib/no-dynamic-require
170+
var bundle = require( join( dirpath, 'stdlib-plot-flat.js' ) );
171+
t.equal( typeof bundle, 'object', 'main export is an object' );
172+
t.equal( typeof bundle.plot, 'function', 'has member' );
173+
t.end();
174+
});
175+
176+
tape( 'project contains a distributable file containing plotting functions (minified)', function test( t ) {
177+
// eslint-disable-next-line stdlib/no-dynamic-require
178+
var bundle = require( join( dirpath, 'stdlib-plot-flat.min.js' ) );
179+
t.equal( typeof bundle, 'object', 'main export is an object' );
180+
t.equal( typeof bundle.plot, 'function', 'has member' );
181+
t.end();
182+
});
183+
184+
tape( 'project contains a distributable file containing base special mathematical functions (unminified)', function test( t ) {
185+
// eslint-disable-next-line stdlib/no-dynamic-require
186+
var bundle = require( join( dirpath, 'stdlib-math-base-special-flat.js' ) );
187+
t.equal( typeof bundle, 'object', 'main export is an object' );
188+
t.equal( typeof bundle.base, 'object', 'has member' );
189+
t.equal( bundle.base.sin( 3.14 ), 0.0015926529164868282, 'returns expected value' );
190+
t.end();
191+
});
192+
193+
tape( 'project contains a distributable file containing base special mathematical functions (minified)', function test( t ) {
194+
// eslint-disable-next-line stdlib/no-dynamic-require
195+
var bundle = require( join( dirpath, 'stdlib-math-base-special-flat.min.js' ) );
196+
t.equal( typeof bundle, 'object', 'main export is an object' );
197+
t.equal( typeof bundle.base, 'object', 'has member' );
198+
t.equal( bundle.base.sin( 3.14 ), 0.0015926529164868282, 'returns expected value' );
199+
t.end();
200+
});
201+
159202
tape( 'project contains a distributable file for REPL functionality (minified)', function test( t ) {
160203
// eslint-disable-next-line stdlib/no-dynamic-require
161204
var bundle = require( join( dirpath, 'stdlib-repl.min.js' ) );
@@ -164,6 +207,24 @@ tape( 'project contains a distributable file for REPL functionality (minified)',
164207
t.end();
165208
});
166209

210+
tape( 'project contains a distributable file containing base statistical distribution functions (unminified)', function test( t ) {
211+
// eslint-disable-next-line stdlib/no-dynamic-require
212+
var bundle = require( join( dirpath, 'stdlib-stats-base-dists-flat.js' ) );
213+
t.equal( typeof bundle, 'object', 'main export is an object' );
214+
t.equal( typeof bundle.base, 'object', 'has member' );
215+
t.equal( typeof bundle.base.dists.normal.pdf( 0.5, 0.0, 1.0 ), 'number', 'returns expected value' );
216+
t.end();
217+
});
218+
219+
tape( 'project contains a distributable file containing base statistical distribution functions (minified)', function test( t ) {
220+
// eslint-disable-next-line stdlib/no-dynamic-require
221+
var bundle = require( join( dirpath, 'stdlib-stats-base-dists-flat.min.js' ) );
222+
t.equal( typeof bundle, 'object', 'main export is an object' );
223+
t.equal( typeof bundle.base, 'object', 'has member' );
224+
t.equal( typeof bundle.base.dists.normal.pdf( 0.5, 0.0, 1.0 ), 'number', 'returns expected value' );
225+
t.end();
226+
});
227+
167228
tape( 'project contains a distributable file exposing a "tree" namespace (unminified)', function test( t ) {
168229
// eslint-disable-next-line stdlib/no-dynamic-require
169230
var bundle = require( join( dirpath, 'stdlib-tree.js' ) );

0 commit comments

Comments
 (0)