Skip to content

Commit

Permalink
[kbn-es/installers] convert to TypeScript (#120560) (#120650)
Browse files Browse the repository at this point in the history
* [kbn-es/installers] convert to TypeScript

* catch invalid urls passed to installArchive()

Co-authored-by: Spencer <email@spalger.com>
  • Loading branch information
kibanamachine and Spencer authored Dec 7, 2021
1 parent 6d7aef0 commit 3f83a8c
Show file tree
Hide file tree
Showing 20 changed files with 379 additions and 354 deletions.
12 changes: 6 additions & 6 deletions packages/kbn-es/src/artifact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ const artifactTest = (requestedLicense, expectedLicense, fetchTimesCalled = 1) =
`${PERMANENT_SNAPSHOT_BASE_URL}/${MOCK_VERSION}/manifest.json`
);
}
expect(artifact.getUrl()).toEqual(MOCK_URL + `/${expectedLicense}`);
expect(artifact.getChecksumUrl()).toEqual(MOCK_URL + `/${expectedLicense}.sha512`);
expect(artifact.getChecksumType()).toEqual('sha512');
expect(artifact.getFilename()).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.${expectedLicense}`);
expect(artifact.spec.url).toEqual(MOCK_URL + `/${expectedLicense}`);
expect(artifact.spec.checksumUrl).toEqual(MOCK_URL + `/${expectedLicense}.sha512`);
expect(artifact.spec.checksumType).toEqual('sha512');
expect(artifact.spec.filename).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.${expectedLicense}`);
};
};

Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Artifact', () => {

it('should return artifact metadata for the correct architecture', async () => {
const artifact = await Artifact.getSnapshot('oss', MOCK_VERSION, log);
expect(artifact.getFilename()).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.oss`);
expect(artifact.spec.filename).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.oss`);
});
});

Expand All @@ -182,7 +182,7 @@ describe('Artifact', () => {

describe('with latest unverified snapshot', () => {
beforeEach(() => {
process.env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 1;
process.env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = '1';
mockFetch(MOCKS.valid);
});

Expand Down
Loading

0 comments on commit 3f83a8c

Please sign in to comment.