UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

36 lines (35 loc) 974 B
"use strict"; var _isFileKey = require("./is-file-key"); describe('isFileKey', () => { it('returns true for a key under the path', () => { expect((0, _isFileKey.isFileKey)({ key: 'path/to/key', path: 'path/to/' })).toBeTruthy(); }); it('returns false for a key under another path', () => { expect((0, _isFileKey.isFileKey)({ key: 'path/another/key', path: 'path/to/' })).toBeFalsy(); }); it('handles no trailing slash in path', () => { expect((0, _isFileKey.isFileKey)({ key: 'path/to/file', path: 'path/to' })).toBeFalsy(); }); it('returns true when providing the key without path', () => { expect((0, _isFileKey.isFileKey)({ key: 'file', path: 'path/to/' })).toBeTruthy(); }); it('returns true when empty key and path', () => { expect((0, _isFileKey.isFileKey)({ key: '', path: '' })).toBeTruthy(); }); }); //# sourceMappingURL=is-file-key.test.js.map