This repository contains all of the NYC Geosearch API acceptance tests, which are automated tests used to identify improvements and regressions between various versions of the API and the underlying data.
- Clone this repo:
git clone git@github.com:NYCPlanning/labs-geosearch-acceptance-tests.git
- Navigate to the project directory:
cd labs-geosearch-acceptance-tests
- Install Dependencies:
npm install
Default to running all tests against production:
$ npm test
Save failing results as JSON files in /failures/
(one per failing test):
$ npm test -- -o json
For a full description of what can go in tests, see the pelias-fuzzy-tester documentation.
Test Creation Script
To create an autocomplete test from a set of terms:
- Create a source
.txt
file inscripts/
- Each line of the source file should be a distinct test case string that's expected to pass against the autocomplete endpoint with a valid
layer: 'address'
property - Run
node scripts/create-json.js [filepath]
to generate the.json
file - Edit the
name
parameter in the generated test file - Manually move the file into
test_cases/