migrate JavaScript to TypeScript

This commit is contained in:
tdurieux
2021-08-11 18:18:45 +02:00
parent ee4a20286d
commit caeff49ab0
58 changed files with 6034 additions and 3096 deletions
-17
View File
@@ -1,17 +0,0 @@
var expect = require("chai").expect;
var assert = require("chai").assert;
const fs = require("fs");
const githubUtils = require("../utils/github");
const fileUtils = require("../utils/file");
const repoUtils = require("../utils/repository");
const db = require("../utils/database");
describe("Test Files Utils", async function() {
describe("List all files", function() {
it("Get all file from repo with more than 1000 files", async function() {
const fullName = "TQRG/BugSwarm";
await fileUtils.getTree({ fullName });
});
});
});
-31
View File
@@ -1,31 +0,0 @@
var expect = require("chai").expect;
var assert = require("chai").assert;
const fs = require("fs");
const githubUtils = require("../utils/github");
const repoUtils = require("../utils/repository");
const db = require("../utils/database");
describe("Test GitHub Utils", async function() {
describe("Download Repository", function() {
const target = "/tmp/repo.zip";
it("Download an exisiting repo to a folder", async function() {
await repoUtils.downloadRepoZip(
{ fullName: "tdurieux/binance-trade-bot" },
target
);
expect(fs.existsSync(target)).to.equal(true, `${target} should exist`);
fs.unlinkSync(target);
});
it("Download a non-exisiting repo to a folder", async function() {
try {
await repoUtils.downloadRepoZip(
{ fullName: "tdurieux/missing" },
target
);
fs.unlinkSync(target);
assert.fail("Should trigger an exception");
} catch (error) {}
});
});
});