Commit Graph

23 Commits

Author SHA1 Message Date
Dev
2fd5c918ce Updated localeService test after recent PR merge
Linted test file
2024-05-20 09:54:40 +01:00
Dev
98620d2e1f Added tests for botDifficultyHelper 2024-05-14 15:45:56 +01:00
Dev
512054d29f Added additional localeService tests
Fixed issue with existing tests overwriting function result that bled into other tests
2024-05-14 10:26:07 +01:00
DrakiaXYZ
adab18e3fb Fix issues around locales (!332)
- Remove locale check for give command (Now handled in the localeService itself)
- Fix variable names/spelling/lowercase in LocaleService.getPlatformForServerLocale (should be no change in behaviour)
- Rewrite LocaleService.getPlatformForClientLocale to not depend on serverSupportedLocales, and instead just use the tables for validity checking
- Expand fallback of client locale handling to include the region code (Handles Czech and Korean locales)
- Write tests for locales

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/332
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-05-13 21:42:58 +00:00
DrakiaXYZ
316234e9ae Fix TradersInfo nextResupply if it is null in profile data (!305)
Add test covering fixNullTraderNextResupply

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/305
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-24 07:13:31 +00:00
Refringe
7d3eaf735a
Test - PaymentService - Refactored payMoney test
Refactored the payMoney test to work with 3.8. The output is no longer returned, but updated by reference.
2024-04-11 21:18:35 -04:00
Refringe
1cd4b055eb
Test - Updates ItemBaseClassService tests to inline with recent code changes 2024-04-10 23:16:04 -04:00
Refringe
85aec72a63
Test - Updates the experince needed to reach level 79 2024-04-10 23:06:40 -04:00
Refringe
3d77ed8595
Seperates ragfair pricing into seperate method
This changes the `RagfairPriceService.getDynamicOfferPriceForOffer()` method to handle the logic surrounding collecting prices for items in offers, while offloading the individual price generation to a new method. The new method, `RagfairPriceService.getDynamicItemPrice()`, is responsible for generating a price for either an item template, or optionally an offerItems collection. This change also allows `getDynamicItemPrice()` to be used elsewhere in the code-base to gather more "realistic" pricing for specific item templates.

Fixes an edge-case where unreasonable prices would only be adjusted on the first item within an offer.

Includes some tests.

Related to #618. This will allow the insurance system to use this method to get better pricing for items.
2024-04-10 12:23:28 -04:00
Refringe
0793df60c2
Formatting Change - Space is now given around object properties. 2023-11-13 12:38:16 -05:00
Refringe
32b47bdc18
Formatting Change - When a statement can be moved into a single line and still be under the maximum line length, it is. 2023-11-13 12:31:52 -05:00
Refringe
e709b6c111
Reformatted imports with (only) Biome. 2023-11-13 11:43:37 -05:00
Refringe
320c8b7d48
Formatting for test classes. 2023-11-10 17:21:20 -05:00
Refringe
a7d3e0d59a
Tests: Moves class (re)resolution to beforeEach to help ensure that all mocks have been reset. 2023-11-06 14:39:12 -05:00
Dev
6f11e3de34 Add ItemBaseClassService tests 2023-11-05 16:44:08 +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
Refringe
1d90a472f2
Testing PaymentService.payMoney
Adds a single test for the basic functionality of the `PaymentService.payMoney` method. It's huge. I hate it. It works. The entire class needs to be refactored to be more testable. Each of these methods should be split up to only have (ideally) a single responsibility--It has about 6 going on right now.
2023-10-30 17:45:17 -04:00
TheSparta
b31a48066b Removed usage of global.container
Importing container from tsyringe directly seems to work fine.
2023-10-29 22:20:35 +00:00
Refringe
ad5e0815b6 Migrated from Jest to Vitest
Basically the same, except it plays nicer with Typescript and ESM.

I have it mostly working, except for a type error:
`TypeError: Int32Array is not a constructor`

But I'm too damn tired it debug it at the moment.
2023-10-29 22:20:32 +00:00
Refringe
00ac9e190a Additional Tests & New Setup
- Adds additional ItemHelper tests
- Attempts to bring container registration into the environment to debug how we can register everything but not actually start the server.
2023-10-29 22:20:32 +00:00