Skip to content

Commit

Permalink
migrate test file to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Jul 5, 2022
1 parent 20961e0 commit 88f9bfd
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Release } from './index';
describe('LS installer', () => {
let release: Release;

before(() => {
beforeAll(() => {
release = new Release({
name: 'terraform-ls',
version: '0.25.2',
Expand Down Expand Up @@ -43,16 +43,20 @@ describe('LS installer', () => {
assert.strictEqual(remoteSum, expectedSum);
});

it('should download the release', async () => {
const build = release.getBuild('darwin', 'amd64');
const tmpDir = tempy.directory();
const zipFile = path.resolve(tmpDir, `terraform-ls_v${release.version}.zip`);

await release.download(build.url, zipFile, 'js-releases/mocha-test');
await release.verify(zipFile, build.filename);

fs.rmSync(tmpDir, {
recursive: true,
});
}).timeout(20 * 1000); // increase timeout for file download
it(
'should download the release',
async () => {
const build = release.getBuild('darwin', 'amd64');
const tmpDir = tempy.directory();
const zipFile = path.resolve(tmpDir, `terraform-ls_v${release.version}.zip`);

await release.download(build.url, zipFile, 'js-releases/mocha-test');
await release.verify(zipFile, build.filename);

fs.rmSync(tmpDir, {
recursive: true,
});
},
20 * 1000, // increase timeout for file download
);
});

0 comments on commit 88f9bfd

Please sign in to comment.