0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 08:30:44 -05:00
server/project/vitest.config.mts

30 lines
954 B
TypeScript
Raw Normal View History

BunJS Runtime, Updated Build System, and... (#992) This is a big one. 🔥 **Changes:** - Targets next major release (v4.0.0) - Switch runtimes from NodeJS to BunJS (bun.sh) - Typescript library support moved to `ESNext` - Typescript compile option `verbatimModuleSyntax` enabled - Updated all interfaces to be imported explicitly as types - Strict mode enabled - Reduces the number of tsconfig files - Pins all dep packages to specific patch versions - Includes Bun lock file in repo (doesn't cause issues like the package-lock did) - Replaces Gulp with a new Typescript based build system - Adds `core-js` as a workaround for Bun not playing nice with `reflect-metadata` - Removes `pkg` and `swc` (Yay Bun!) - Updated package scripts and entry point system to be more intuitive - Updated VSCode workspace configurations - Updated `.gitignore` to align with updated project structure - Updated Biome configuration to align with updated project structure - `Program.ts` - Removes call to set encoding on the process - `global.d.ts` - Added underscores to build globals to match other global names - `JsonUtil.ts` - Replaced old `fixJson` package with newer `jsonrepair` package - `HashUtil.ts` - Replaced old `buffer-crc32` package with built-in `node:zlib` package - `DatabaseImporter.ts` - Updates database validation object to be flat, where the keys are the relative path to the file - `BunTimer.ts` - Adds an easy to use timer class that's compatible with nanoseconds. **TODO:** - Look into mod loading. I think we use a TS transpiler for mods and I believe that can be removed now. - Bun includes a number of APIs that can be used in place of Node's packages (built-in or otherwise); HTTP server, WebSocket server, File IO, Hashing, File Globing, Testing... Each of these should be utilized where ever possible. - Update in-repo documentation to reference BunJS instead of NodeJS.
2024-12-21 17:46:39 -05:00
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
export default defineConfig({
cacheDir: "./tests/__cache__",
test: {
name: "spt-server",
reporters: ["default"],
root: "./",
include: ["**/*.{test,spec}.?(c|m)[jt]s?(x)"],
environment: "./tests/CustomEnvironment.ts",
globals: true,
coverage: {
provider: "istanbul",
reporter: ["text", "html"],
2023-11-04 18:37:16 +00:00
reportsDirectory: "./tests/__coverage__",
reportOnFailure: true,
2023-11-04 18:37:16 +00:00
all: true,
include: ["src"],
2023-11-10 15:16:53 -05:00
exclude: ["src/models/**", "tests/**"],
},
pool: "threads",
poolOptions: { threads: { singleThread: true, isolate: false } },
BunJS Runtime, Updated Build System, and... (#992) This is a big one. 🔥 **Changes:** - Targets next major release (v4.0.0) - Switch runtimes from NodeJS to BunJS (bun.sh) - Typescript library support moved to `ESNext` - Typescript compile option `verbatimModuleSyntax` enabled - Updated all interfaces to be imported explicitly as types - Strict mode enabled - Reduces the number of tsconfig files - Pins all dep packages to specific patch versions - Includes Bun lock file in repo (doesn't cause issues like the package-lock did) - Replaces Gulp with a new Typescript based build system - Adds `core-js` as a workaround for Bun not playing nice with `reflect-metadata` - Removes `pkg` and `swc` (Yay Bun!) - Updated package scripts and entry point system to be more intuitive - Updated VSCode workspace configurations - Updated `.gitignore` to align with updated project structure - Updated Biome configuration to align with updated project structure - `Program.ts` - Removes call to set encoding on the process - `global.d.ts` - Added underscores to build globals to match other global names - `JsonUtil.ts` - Replaced old `fixJson` package with newer `jsonrepair` package - `HashUtil.ts` - Replaced old `buffer-crc32` package with built-in `node:zlib` package - `DatabaseImporter.ts` - Updates database validation object to be flat, where the keys are the relative path to the file - `BunTimer.ts` - Adds an easy to use timer class that's compatible with nanoseconds. **TODO:** - Look into mod loading. I think we use a TS transpiler for mods and I believe that can be removed now. - Bun includes a number of APIs that can be used in place of Node's packages (built-in or otherwise); HTTP server, WebSocket server, File IO, Hashing, File Globing, Testing... Each of these should be utilized where ever possible. - Update in-repo documentation to reference BunJS instead of NodeJS.
2024-12-21 17:46:39 -05:00
alias: {
"@spt": fileURLToPath(new URL("src", import.meta.url)),
"@tests": fileURLToPath(new URL("tests", import.meta.url)),
},
2023-11-10 15:16:53 -05:00
},
});