Skip to content

Commit

Permalink
fix: exclude mirror-box in jest, and fix download prefetched-json
Browse files Browse the repository at this point in the history
  • Loading branch information
asaadam committed Sep 9, 2021
1 parent 3d73bb3 commit 708fc3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
20 changes: 1 addition & 19 deletions etc/mirror-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import chalk from "chalk";
import fetch from "cross-fetch";
import ora from "ora";
import { toSecond } from "../lib/string-utils";
import { fetchDatabase } from "./fetchers/fetch-database";

export async function mirror(name: string) {
const start = process.hrtime();
Expand All @@ -17,25 +16,8 @@ export async function mirror(name: string) {
});
}

export async function mirrorDatabase() {
const start = process.hrtime();
const spinner = ora(`${chalk.yellowBright("Mirroring Database")}`).start();
spinner.start(`${chalk.yellowBright("Fetching next data...")}`);

fetchDatabase()
.then(() => {
const end = `${toSecond(process.hrtime(start))} seconds`;
spinner.succeed(
`Finished mirroring Database in ${chalk.greenBright(end)}`,
);
})
.catch((err) => {
chalk.red(err);
});
}

(function main() {
void mirror("wbw-faq-sheets.json");
void mirror("wbw-sheets.json");
void mirrorDatabase();
void mirror("wbw-database.json");
})();
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
"!./(components|etc|lib|pages)/**/__tests__/**/*.test.(ts|tsx|js|jsx)",
"!./(components|etc|lib|pages)/**/__mocks__/**/*.(ts|tsx|js|jsx)",
"!./etc/fetchers/fetch-wbw.ts",
"!./etc/mirror-box.ts",
],
coverageThreshold: {
global: {
Expand Down

0 comments on commit 708fc3b

Please sign in to comment.