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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
connorjburton authored and juanarbol committed Oct 7, 2022
1 parent 3aa590b commit 1061bd6
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 1061bd6

Please sign in to comment.