workspace: add nyc coverage test

pull/420/head
undefined 2 years ago
parent 7903d012da
commit b48dc5344a

2
.gitignore vendored

@ -11,6 +11,8 @@ dist/
*.tsbuildinfo
*.hydro
.coverage
coverage
.nyc_output
benchmark.json
globalConfig.json
*.out

@ -0,0 +1,3 @@
extension: [.js, .ts, .jsx, .tsx]
exclude: [node_modules, .yarn]
reporter: [text, lcov]

@ -58,6 +58,7 @@
"mocha": "^10.0.0",
"mongodb": "^3.7.3",
"mongodb-memory-server": "^8.8.0",
"nyc": "^15.1.0",
"ora": "^6.1.2",
"semver": "^7.3.7",
"supertest": "^6.2.4",

@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.22.11",
"version": "2.22.12",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",

@ -1,4 +1,3 @@
import crypto from 'crypto';
import { EventEmitter } from 'events';
import path from 'path';
import fs from 'fs-extra';
@ -16,14 +15,6 @@ export function parseFilename(filePath: string) {
return t[t.length - 1];
}
const encrypt = (algorithm: string, content: crypto.BinaryLike) => {
const hash = crypto.createHash(algorithm);
hash.update(content);
return hash.digest('hex');
};
export const md5 = (content: string) => encrypt('md5', content);
export class Queue<T> extends EventEmitter {
queue: T[] = [];
waiting: any[] = [];

Loading…
Cancel
Save