path.test.ts 368 B

12345678910111213
  1. import { expect, test } from 'vitest';
  2. import { joinPath, pathDirectory } from '../src';
  3. test('it joins path together', () => {
  4. const result = joinPath('foo', 'bar', 'baz');
  5. expect(result).toEqual('foo/bar/baz');
  6. });
  7. test('it gets the directory of a path', () => {
  8. const result = pathDirectory('foo/bar/baz');
  9. expect(result).toEqual('foo/bar');
  10. });