Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 5, 2023
1 parent 58a59a3 commit 9c6b5d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/process-node-version.svg
[npm-url]: https://npmjs.org/package/@stdlib/process-node-version

[test-image]: https://github.com/stdlib-js/process-node-version/actions/workflows/test.yml/badge.svg?branch=v0.1.1
[test-url]: https://github.com/stdlib-js/process-node-version/actions/workflows/test.yml?query=branch:v0.1.1
[test-image]: https://github.com/stdlib-js/process-node-version/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/process-node-version/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/process-node-version/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/process-node-version?branch=main
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
"@stdlib/fs-read-file": "^0.1.1"
},
"devDependencies": {
"@stdlib/assert-is-browser": "^0.1.0",
"@stdlib/assert-is-windows": "^0.1.0",
"@stdlib/process-exec-path": "^0.1.0",
"@stdlib/assert-is-browser": "^0.1.1",
"@stdlib/assert-is-windows": "^0.1.1",
"@stdlib/process-exec-path": "^0.1.1",
"proxyquire": "^2.0.0",
"semver": "^6.0.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
Expand Down
27 changes: 4 additions & 23 deletions test/dist/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2023 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,32 +21,13 @@
// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var IS_NODE = require( '@stdlib/assert-is-node' );
var VERSION = require( './../../dist' );
var main = require( './../../dist' );


// TESTS //

tape( 'main export is either a string or `null`', function test( t ) {
tape( 'main export is defined', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof VERSION === 'string' || VERSION === null, true, 'main export is either a string or `null`' );
t.end();
});

tape( 'if running in a Node.js process, the main export is a string; otherwise, the export is equal to `null`.', function test( t ) {
if ( IS_NODE ) {
t.equal( typeof VERSION, 'string', 'exports a string' );
} else {
t.equal( VERSION, null, 'exports null' );
}
t.end();
});

tape( 'if not running in a Node.js process, the main export is `null`', function test( t ) {
var VERSION = proxyquire( './../dist', {
'@stdlib/assert-is-node': false
});
t.equal( VERSION, null, 'exports null' );
t.strictEqual( main !== void 0, true, 'main export is defined' );
t.end();
});

0 comments on commit 9c6b5d6

Please sign in to comment.