mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-28 00:47:13 +09:00
Tests live in tests/, mirroring each package's src, and in plugins/*/test/*.test.ts. They are TypeScript run by Node's type stripping, so the @tapjs/typescript plugin is disabled and `pnpm install` runs tap build to apply that. The first tests cover the largest lib files: link, subscriptions, config classes and prometheus. A shared helper checks the JSON serialisable class pattern, and one test runs it on every serialisable class lib exports, with samples generated from each class's schema. Known bugs the new tests found are marked todo. Mocha, codecov and the existing CI matrix are unchanged; tap.yml runs the new suite on the latest Node.js and Factorio. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
2.3 KiB
JSON
66 lines
2.3 KiB
JSON
{
|
|
"name": "root",
|
|
"private": true,
|
|
"files": [],
|
|
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "tsc --build",
|
|
"watch": "tsc --build --watch",
|
|
"build-mod": "pnpm run -r build-mod --output-dir ../../dist",
|
|
"test": "pnpm run build && NODE_EXTRA_CA_CERTS=$(pwd)/test/file/tls/cert.pem mocha --enable-source-maps --check-leaks -R ./test/reporter.cjs --recursive test \"plugins/*/test/**\" --exclude \"test/manual/**\"",
|
|
"silent-test": "TEST_OUTPUT=silent pnpm test",
|
|
"fast-test": "FAST_TEST=y pnpm test",
|
|
"no-external-test": "NO_EXTERNAL_TEST=y pnpm test",
|
|
"cover": "c8 pnpm test",
|
|
"fast-cover": "FAST_TEST=y c8 pnpm test",
|
|
"ci-cover": "c8 --reporter=lcovonly pnpm test",
|
|
"test:tap": "pnpm run build && tap --disable-coverage",
|
|
"test:unit": "pnpm run build && tap --disable-coverage \"tests/!(integrations|shared)/**/*.test.ts\"",
|
|
"test:integration": "pnpm run build && tap --disable-coverage tests/integrations",
|
|
"test:plugins": "pnpm run build && tap --disable-coverage \"plugins/*/test/**/*.test.ts\"",
|
|
"test:coverage": "pnpm run build && tap --allow-incomplete-coverage --coverage-report=text --coverage-report=html --no-browser",
|
|
"test:typecheck": "tsc -p tests",
|
|
"lint": "oxlint packages plugins test tests",
|
|
"lint-fix": "oxlint --fix packages plugins test tests",
|
|
"clean": "node ./scripts/clean.js",
|
|
"bundle-dependencies": "bundle-dependencies",
|
|
"prepare": "tap build"
|
|
},
|
|
"c8": {
|
|
"exclude": [
|
|
"test/**",
|
|
"plugins/*/test/**",
|
|
"temp/**"
|
|
]
|
|
},
|
|
"engines": {
|
|
"node": "^22.18.0 || >=24.2.0"
|
|
},
|
|
"workspaces": [
|
|
"packages/*",
|
|
"plugins/*",
|
|
"external_plugins/*",
|
|
"external_plugins/*/*"
|
|
],
|
|
"devDependencies": {
|
|
"@clusterio/controller": "workspace:^",
|
|
"@clusterio/ctl": "workspace:^",
|
|
"@clusterio/host": "workspace:^",
|
|
"@clusterio/lib": "workspace:^",
|
|
"@clusterio/web_ui": "workspace:^",
|
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
"@types/node": "catalog:",
|
|
"c8": "^12.0.0",
|
|
"express": "catalog:",
|
|
"jsonwebtoken": "catalog:",
|
|
"mocha": "^12.0.3",
|
|
"oxlint": "^1.88.0",
|
|
"tap": "^21.8.1",
|
|
"typescript": "catalog:",
|
|
"yargs": "catalog:",
|
|
"yauzl": "catalog:",
|
|
"yazl": "catalog:"
|
|
}
|
|
}
|