mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: Add ID tests to CI (#456)
* tools: Add script to run ID tests * ci: Add game ID tests * tools/id-tests: Import games directly from file * ci/id: Update ID tests to official repo * ci/id: Cache rust deps even if tests fail * Add newlines
This commit is contained in:
parent
6ecb809512
commit
68f9c01886
2 changed files with 54 additions and 0 deletions
18
tools/run-id-tests.js
Normal file
18
tools/run-id-tests.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { spawnSync } from 'node:child_process';
|
||||
import process from 'node:process';
|
||||
|
||||
// Import directly from file so that this script works without dependencies installed.
|
||||
import { games } from './../lib/games.js';
|
||||
|
||||
const ID_TEST_BIN = process.env["GAMEDIG_ID_TESTER"] || "gamedig-id-tests";
|
||||
|
||||
const result = spawnSync(ID_TEST_BIN, {
|
||||
input: JSON.stringify(games),
|
||||
stdio: ['pipe', 'inherit', 'inherit'],
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
process.exit(result.status);
|
||||
Loading…
Add table
Add a link
Reference in a new issue