diff --git a/packages/kbn-screenshotting-server/src/paths.test.ts b/packages/kbn-screenshotting-server/src/paths.test.ts new file mode 100644 index 00000000000000..8460f5e7f72a72 --- /dev/null +++ b/packages/kbn-screenshotting-server/src/paths.test.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ChromiumArchivePaths } from './paths'; + +describe('ChromiumArchivePaths', () => { + it('should download chromium archive to a specific path', () => { + const ChromiumArchivePathsInstance = new ChromiumArchivePaths(); + expect(ChromiumArchivePathsInstance.archivesPath).toEqual( + expect.stringContaining('kibana/.chromium') + ); + }); +}); diff --git a/packages/kbn-screenshotting-server/src/paths.ts b/packages/kbn-screenshotting-server/src/paths.ts index f3c339988567ff..e5b958ddc1fc06 100644 --- a/packages/kbn-screenshotting-server/src/paths.ts +++ b/packages/kbn-screenshotting-server/src/paths.ts @@ -102,7 +102,7 @@ export class ChromiumArchivePaths { ]; // zip files get downloaded to a .chromium directory in the kibana root - public readonly archivesPath = path.resolve(__dirname, '../../../../../../.chromium'); + public readonly archivesPath = path.resolve(__dirname, '../../../.chromium'); public find(platform: string, architecture: string, packages: PackageInfo[] = this.packages) { return packages.find((p) => p.platform === platform && p.architecture === architecture);