Skip to content


Browse files Browse the repository at this point in the history
test: add extra tests for basename with ext option
PR-URL: #44772
Reviewed-By: Luigi Pinca <>
Reviewed-By: Rich Trott <>
  • 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
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.