mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
b08c194c3d
* Implement streaks * Improve code * Update package.json * Store streak on the user * Pretty-fix * Ensure that streak is up to date * Fix issue in streak calculation * Revert prettier changes * Update polish.json * Update db.ts * Remove initial calculation * Write mandatory test * using strict equality * moved functions to the utils file * importing utils * adding streak to breakdown, rounding and parsing streak modifier * renamed variable * renamed fields * using correct field name * added streaks to configuration * showing streak during xp breakdown * incrementing streak earlier checking configuration before applying modifier * returning streak to the client * setting local streak with the number returned from the backedn * only reading streak when updating profile instead of updating * sending streak information in profile * only showing streak if greater than 0 * setting to empty if no streak * renamed config property * updated streak calculation * refactored isYesterday * refactored streak update * only displaying if streak larger than 1 * merged configuration properties into 1 * added configuration for max streak bonus * added isToday check back (derp) * reverted streaks back to multiplier approach * using better maprange functin * removed import * moved test to dal spec * clamping * removed imports * fixed test * increased coverage * removed angry console log * typo * using date now instead of dates * mocking date now awaiting expect * not using date Co-authored-by: Anonymous <110769200+fasttyperdog@users.noreply.github.com> Co-authored-by: Rizwan Mustafa <rizwanmustafa0000@gmail.com> Co-authored-by: Miodec <bartnikjack@gmail.com>
16 lines
375 B
TypeScript
16 lines
375 B
TypeScript
import { defaults as tsjPreset } from "ts-jest/presets";
|
|
|
|
export default {
|
|
preset: "@shelf/jest-mongodb",
|
|
transform: tsjPreset.transform,
|
|
setupFilesAfterEnv: ["<rootDir>/setup-tests.ts"],
|
|
coverageThreshold: {
|
|
global: {
|
|
// These percentages should never decrease
|
|
statements: 40,
|
|
branches: 40,
|
|
functions: 25,
|
|
lines: 43,
|
|
},
|
|
},
|
|
};
|