Commit Graph

753 Commits

Author SHA1 Message Date
TheSparta
de83dee158 Fixed vscode launch configuration for vitest 2023-11-05 19:40:15 +00:00
TheSparta
1f0318e66d Create container once before all tests
- Doesn't recreate the container for each test file, only loads the database once at the start, makes it much faster.
- Every test file should be imported in `Setup.test.ts` in order for it to work.
2023-11-05 16:59:54 +00:00
Dev
6f11e3de34 Add ItemBaseClassService tests 2023-11-05 16:44:08 +00:00
Dev
c12819ce33 Check for correct return type 2023-11-05 12:40:50 +00:00
Dev
7e409735d1 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-05 12:39:38 +00:00
Dev
c7dfc5b9cf Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-05 12:39:20 +00:00
Dev
8f70b03284 Fix hasBuyRestrictions erroring on bad input data
Fix isItemTplStackable erroring on bad input data
2023-11-05 12:37:17 +00:00
Dev
84f3f0e3d5 Add additional pmc response 2023-11-05 12:21:44 +00:00
Dev
d1614b19a6 Add tests for InRaidHelper 2023-11-05 10:49:20 +00:00
Dev
d4f2139236 Add additional tests to ItemHelper.test 2023-11-05 10:19:00 +00:00
Dev
ed20707935 Add tests for BotLevelGenerator 2023-11-05 09:20:11 +00:00
Refringe
98a35f4b47
Merge branch '3.8.0' into testing-redux 2023-11-04 21:12:49 -04:00
TheSparta
0fff6afc8c switched coverage provider from v8 to istanbul 2023-11-04 21:07:44 +00:00
Dev
8ee176b9d8 Handle when fillCamora() cannot find camora slots in weapons modPool 2023-11-04 20:11:09 +00:00
Dev
69b32fabdf Add HandbookHelper tests 2023-11-04 19:42:07 +00:00
TheSparta
71b5ce7512 fixed __coverage__ folder location 2023-11-04 18:37:16 +00:00
Dev
8f21ee2ef3 Allow coverage to show correct files in src folder 2023-11-04 18:31:37 +00:00
TheSparta
a865709535 added --coverage to test:ui script 2023-11-04 17:09:14 +00:00
TheSparta
9638288381 Fix level calcualtion function 2023-11-04 17:01:24 +00:00
TheSparta
1b737189b7 Added coverage reportOnFailure and removed enabled by default 2023-11-04 14:54:17 +00:00
TheSparta
1b930afa2f Added tests/__coverage__ to gitignore 2023-11-04 14:53:48 +00:00
TheSparta
45dad54e3e Fixed PlayerService.calculateLevel 2023-11-04 14:53:08 +00:00
Dev
6ca19150bc Add BotHelper tests 2023-11-04 13:34:09 +00:00
Dev
85b815f32e Add tests for PlayerServer.calculateLevel() 2023-11-04 11:43:04 +00:00
Dev
ebe7dc68c3 Add isInStash() tests to PaymentService.tests 2023-11-04 11:22:07 +00:00
Dev
86c519b117 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-04 10:50:13 +00:00
Dev
75958ee7d2 Replace hard coded blacklist in isValidItem() with more appropriate call to ItemFilterService.isValidItem() 2023-11-04 10:49:52 +00:00
Dev
24894643de Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-04 10:43:06 +00:00
Dev
ab01e42271 Call getDynamicItemPrice() correctly inside getItemPrice() 2023-11-04 10:28:33 +00:00
Dev
b303849ad1 Add 3 test for getItemStackSize() 2023-11-04 10:21:56 +00:00
Dev
2f7f8a3f62 use correct base type id for test 2023-11-04 09:53:30 +00:00
Dev
432f778512 Make randomiseAmmoStackSize() and randomiseMoneyStackSize() not purge the entire upd object
Always randomise the ammo stack size, not only if it doesnt have one
2023-11-04 09:08:33 +00:00
Refringe
047884e9c7
Additional InsuranceController Tests
- Adds tests for the remaining methods in the `InsuranceController`.
- Adds a `countAllInsuranceItems()` method to the `InsuranceController`.
- Adds the Vitest UI and coverage packages.
- Updates the `profileInsuranceFactory` to use second-epoch dates instead of millisecond-epoch dates.
- Updates the `InsuranceController.fetchHideoutItemParent()` method to log a warning when an item with a slotId of 'hideout' cannot be found.

TODO:
- The Vitest coverage options are not working.
2023-11-03 17:39:33 -04:00
Dev
93209e4a76 Add config option to force stock to spawn on a bot during weapon generation
Enable it for various bot types (most bosses/raiders)
2023-11-03 17:40:00 +00:00
Dev
b808850e7e Remove duplicate mod_magazine key 2023-11-03 17:15:42 +00:00
Dev
60b658c6f6 Correct pmc response to ensure consistency with meme-lore 2023-11-03 16:44:15 +00:00
Dev
b62850e03e Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-02 21:25:31 +00:00
Dev
a5a0bf82d7 Changes after feedback from Drakia 2023-11-02 21:16:31 +00:00
Dev
e9be58d5f4 Update bot XP values + other bot values 2023-11-02 16:17:03 +00:00
TheSparta
e327df7504 Override WinstonLogger registration with a mock 2023-11-02 15:58:16 +00:00
Dev
2511b8bba2 Update locales 2023-11-02 15:26:13 +00:00
Dev
7a3acaee95 update shoreline and factory 2023-11-02 15:25:40 +00:00
Dev
e664742e49 Update map spawn point data values (missing shoreline) 2023-11-02 15:08:20 +00:00
Dev
8ee0188fdd Reduce flashlight usage on cultists to 5% 2023-11-02 15:02:45 +00:00
Dev
981da646b0 Add 2023 haloween event system
Event bots are generated from their base type, then their role is updated before being sent to the client e.g. peacefullZryachiyEvent becomes bossZryachiy for generation, then back to peacefullZryachiyEvent
2023-11-02 15:02:18 +00:00
Dev
9949d3c7ff Correct spt version 2023-11-02 11:54:38 +00:00
Dev
0a85f6f319 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-02 09:00:14 +00:00
Dev
6f48a29713 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server 2023-11-02 08:59:55 +00:00
Dev
c782b58e64 Remoev duplicate name 2023-11-02 08:59:43 +00:00
DrakiaXYZ
ebeda336db Implement live-like calculation of Weapon Maintenance XP (!164)
- Implement formula based on 30 weapon repairs done on live
- Return the repair amount as `repairAmount` from `repairItemByKit`
- Add an additional `repairPoints` to `RepairDetails` to return the repair points used
- Update `repairAmount` references to `repairPoints` to keep old behavior
- Add new parameter to rewardSkillPoints that applies live-like level scaling
- Only give weapon maintenance XP when using a repair kit

This implementation comes with a "Crit Fail" and "Crit Success" mechanic to account for live sometimes randomly being -4 or +4 off from my estimated values. By default the chance of each is 10%, and they can overlap and cancel each other out

Spreadsheet of live repair data:
https://docs.google.com/spreadsheets/d/1-tR4WYelhZfKZ3ZDbxr3nd73Y60E1wQRjDWONpMVSew/edit?usp=sharing

Useful columns:
C: The amount of dura attempted to be repaired, this is used in the estimated skill calculated
G: Hand entered value of how much skill gain I actually saw on live (Multiplied by 10 for readability. So "3.2" would be "32")
J: The estimated skill gain, based on the calculation included in this merge request
K: How far off the estimated skill gain was (Negative implies we guessed high and the actual result was lower)

One thing of note:
I've modified all the existing references to `repairAmount` to be the new `repairPoints` when a repair kit is used. This is to keep the existing behaviour outside of my direct changes as much as possible.

However, this seems to be incorrect in some cases (For example, buff chance is repairPoints/maxDura, but repairPoints will go down the higher your int. I'm assuming this is meant to be repairedDura/maxDura). May want to update these references to use `repairAmount` once they've been confirmed to expect the repair amount instead of repair points used.

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/164
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-11-02 08:56:02 +00:00