addons/shared/textmate-lib/splitPath.test.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import splitPath from './splitPath';
b69ab319
b69ab3110describe('splitPath', () => {
b69ab3111 test('splits path into dirname and basename', () => {
b69ab3112 expect(splitPath('')).toEqual(['', '']);
b69ab3113 expect(splitPath('foo')).toEqual(['', 'foo']);
b69ab3114 expect(splitPath('/foo')).toEqual(['', 'foo']);
b69ab3115 expect(splitPath('/foo/bar')).toEqual(['/foo', 'bar']);
b69ab3116 expect(splitPath('foo/bar')).toEqual(['foo', 'bar']);
b69ab3117 expect(splitPath('foo/bar/baz')).toEqual(['foo/bar', 'baz']);
b69ab3118 });
b69ab3119});