sda
Version:
Software development assistant
27 lines • 1.18 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const getAbsolutePath_1 = __importDefault(require("./getAbsolutePath"));
test('getAbsolutePath with an absolute path', () => {
const pathToTest = 'C:\\testA\\testB';
const basePath = 'D:\\a\\b';
const res = getAbsolutePath_1.default(pathToTest, basePath);
expect(res).toEqual(pathToTest);
});
test('getAbsolutePath with a relative path', () => {
const pathToTest = 'testA\\testB';
const basePath = 'D:\\a\\b';
const res = getAbsolutePath_1.default(pathToTest, basePath);
expect(res).toEqual(path.join(basePath, pathToTest));
});
//# sourceMappingURL=getAbsolutePath.test.js.map