Skip to content

Commit

Permalink
test: add extra tests for basename with ext option
Browse files Browse the repository at this point in the history
PR-URL: #44772
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
connorjburton authored and danielleadams committed Oct 5, 2022
1 parent dc6379b commit 5c63d14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-path-basename.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const path = require('path');
assert.strictEqual(path.basename(__filename), 'test-path-basename.js');
assert.strictEqual(path.basename(__filename, '.js'), 'test-path-basename');
assert.strictEqual(path.basename('.js', '.js'), '');
assert.strictEqual(path.basename('js', '.js'), 'js');
assert.strictEqual(path.basename('file.js', '.ts'), 'file.js');
assert.strictEqual(path.basename('file', '.js'), 'file');
assert.strictEqual(path.basename('file.js.old', '.js.old'), 'file');
assert.strictEqual(path.basename(''), '');
assert.strictEqual(path.basename('/dir/basename.ext'), 'basename.ext');
assert.strictEqual(path.basename('/basename.ext'), 'basename.ext');
Expand Down

0 comments on commit 5c63d14

Please sign in to comment.