Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Oct 7, 2020
1 parent 2202ab1 commit 21df142
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/docusaurus-theme-classic/src/__tests__/utils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import {isSamePath} from '../utils';

describe('isSamePath', () => {
test('should be true for compared path without trailing slash', () => {
expect(isSamePath('/docs', '/docs')).toBeTruthy();
});

test('should be true for compared path with trailing slash', () => {
expect(isSamePath('/docs', '/docs')).toBeTruthy();
});

test('should be false for compared path with double trailing slash', () => {
expect(isSamePath('/docs', '/docs//')).toBeFalsy();
});
});

0 comments on commit 21df142

Please sign in to comment.