Skip to content

Commit 6c4ab59

Browse files
committed
Rename files and remove browser environment check
1 parent 07ab92a commit 6c4ab59

File tree

7 files changed

+44
-88
lines changed

7 files changed

+44
-88
lines changed

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/benchmark/benchmark.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
// MODULES //
44

55
var bench = require( '@stdlib/bench' );
6+
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
67
var isBuffer = require( '@stdlib/assert/is-buffer' );
78
var pkg = require( './../package.json' ).name;
89
var image = require( './../lib' );
910

1011

12+
// VARIABLES //
13+
14+
var opts = {
15+
'skip': IS_BROWSER
16+
};
17+
18+
1119
// MAIN //
1220

13-
bench( pkg, function benchmark( b ) {
21+
bench( pkg, opts, function benchmark( b ) {
1422
var data;
1523
var i;
1624
b.tic();

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/benchmark/benchmark.non_browser.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/lib/index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,7 @@
1414

1515
// MODULES //
1616

17-
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
18-
19-
20-
// MAIN //
21-
22-
var image;
23-
if ( IS_BROWSER ) {
24-
image = require( './browser.js' );
25-
} else {
26-
image = require( './acanthus_mollis.js' );
27-
}
17+
var image = require( './main.js' );
2818

2919

3020
// EXPORTS //
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
// MODULES //
4+
5+
var tape = require( 'tape' );
6+
var isBuffer = require( '@stdlib/assert/is-buffer' );
7+
var image = require( './../lib' );
8+
9+
10+
// TESTS //
11+
12+
tape( 'main export is a function', function test( t ) {
13+
t.ok( true, __filename );
14+
t.equal( typeof image, 'function', 'main export is a function' );
15+
t.end();
16+
});
17+
18+
tape( 'the function returns a buffer object', function test( t ) {
19+
var data = image();
20+
t.equal( isBuffer( data ), true, 'returns a buffer object' );
21+
t.end();
22+
});

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/test/test.js

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,28 @@
33
// MODULES //
44

55
var tape = require( 'tape' );
6-
var proxyquire = require( 'proxyquire' );
6+
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
77
var isBuffer = require( '@stdlib/assert/is-buffer' );
88
var image = require( './../lib' );
99

1010

11-
// TESTS //
11+
// VARIABLES //
1212

13-
tape( 'main export is a function', function test( t ) {
14-
t.ok( true, __filename );
15-
t.equal( typeof image, 'function', 'main export is a function' );
16-
t.end();
17-
});
13+
var opts = {
14+
'skip': IS_BROWSER
15+
};
1816

19-
tape( 'main export is a function (browser)', function test( t ) {
20-
var image = proxyquire( './../lib', {
21-
'@stdlib/assert/is-browser': true
22-
});
23-
t.equal( typeof image, 'function', 'main export is a function' );
24-
t.end();
25-
});
2617

27-
tape( 'main export is a function (non-browser)', function test( t ) {
28-
var image = proxyquire( './../lib', {
29-
'@stdlib/assert/is-browser': false
30-
});
18+
// TESTS //
19+
20+
tape( 'main export is a function', opts, function test( t ) {
21+
t.ok( true, __filename );
3122
t.equal( typeof image, 'function', 'main export is a function' );
3223
t.end();
3324
});
3425

35-
tape( 'the function returns a buffer object', function test( t ) {
26+
tape( 'the function returns a buffer object', opts, function test( t ) {
3627
var data = image();
3728
t.equal( isBuffer( data ), true, 'returns a buffer object' );
3829
t.end();
3930
});
40-
41-
tape( 'the function returns a buffer object (browser)', function test( t ) {
42-
var image;
43-
var data;
44-
45-
image = proxyquire( './../lib', {
46-
'@stdlib/assert/is-browser': true
47-
});
48-
49-
data = image();
50-
t.equal( isBuffer( data ), true, 'returns a buffer object' );
51-
t.end();
52-
});
53-
54-
tape( 'the function returns a buffer object (non-browser)', function test( t ) {
55-
var image;
56-
var data;
57-
58-
image = proxyquire( './../lib', {
59-
'@stdlib/assert/is-browser': false
60-
});
61-
62-
data = image();
63-
t.equal( isBuffer( data ), true, 'returns a buffer object' );
64-
t.end();
65-
});

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/test/test.acanthus_mollis.js renamed to lib/node_modules/@stdlib/datasets/img-acanthus-mollis/test/test.main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
var tape = require( 'tape' );
66
var proxyquire = require( 'proxyquire' );
7-
var image = require( './../lib/acanthus_mollis.js' );
7+
var image = require( './../lib/main.js' );
88

99

1010
// TESTS //
@@ -16,7 +16,7 @@ tape( 'main export is a function', function test( t ) {
1616
});
1717

1818
tape( 'the function throws an error if unable to load data', function test( t ) {
19-
var image = proxyquire( './../lib/acanthus_mollis.js', {
19+
var image = proxyquire( './../lib/main.js', {
2020
'@stdlib/fs/read-file': {
2121
'sync': readFile
2222
}

0 commit comments

Comments
 (0)