Skip to content

Commit

Permalink
add test for addLeadingSlash
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jul 21, 2020
1 parent 6d4ee45 commit 17f66e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/docusaurus-utils/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
removeSuffix,
removePrefix,
getFilePathForRoutePath,
addLeadingSlash,
} from '../index';

describe('load utils', () => {
Expand Down Expand Up @@ -412,6 +413,15 @@ describe('addTrailingSlash', () => {
});
});

describe('addLeadingSlash', () => {
test('should no-op', () => {
expect(addLeadingSlash('/abc')).toEqual('/abc');
});
test('should add /', () => {
expect(addLeadingSlash('abc')).toEqual('/abc');
});
});

describe('removeTrailingSlash', () => {
test('should no-op', () => {
expect(removeTrailingSlash('/abcd')).toEqual('/abcd');
Expand Down

0 comments on commit 17f66e1

Please sign in to comment.