- Create a config file in the config folder :
config/config.yaml - Open
package.jsonand double-check that thestartcommand has a--config=option that matches the path to this file - Run
npm run start - Go to http://localhost:3000/api/v1/ to test an API
The project includes a CLI test runner at src/tests/text2query-test.ts.
It executes all query.txt / expected.json test cases, compares API responses,
and generates an Excel report.
npm run test:t2q -- --help
This help is auto-generated by commander.
- Start the API first:
npm run start
- Run the test runner (in another terminal):
npm run test:t2q -- --testsDir ./src/tests/text2query --endpoint http://localhost:3000/api/v1/dbpedia-en/text2query --runs 2 --outputDir ./src/tests/test-report --reportFile test-report.xlsx
--testsDir <path>: Root folder containing tests (recursive scan).--endpoint <url>: Full Text2Query API endpoint URL.--runs <number>: Number of runs per test case (default:3).--outputDir <path>: Output folder for mirrored test artifacts and report.--reportFile <name>: Excel report filename (default:test-report.xlsx).
The runner mirrors the test folder structure under outputDir.
For each test case folder:
- Copies
query.txt - Copies
expected.json - Creates
output/with execution artifacts: runN-response.jsonon success "OK" or unsuccess "KO"runN-error.jsonon failure