fix(pluginHandlers): properly check if path is inside another (#1014)

This commit is contained in:
Raphael von der Grün
2020-07-08 23:31:16 +02:00
committed by GitHub
parent 80ad635348
commit 8ef8d994df
4 changed files with 18 additions and 2 deletions
+9
View File
@@ -108,6 +108,15 @@ describe('common platform handler', function () {
expect(s).toHaveBeenCalled();
expect(s).toHaveBeenCalledWith(java_file, resolvedDest);
});
it('should handle relative paths when checking for sub paths', () => {
fs.outputFileSync(java_file, 'contents');
const relativeProjectPath = path.relative(process.cwd(), project_dir);
expect(() => {
copyFile(test_dir, java_file, relativeProjectPath, dest);
}).not.toThrow();
});
});
describe('copyNewFile', function () {