swagger-editor
swagger-editor copied to clipboard
Flaky test: `validate-semantic/2and3/paths.js`
Q&A (please complete the following information)
- OS: [e.g. macOS]
- Browser: [e.g. chrome, safari]
- Version: [e.g. 22]
- Method of installation: [e.g. npm, dist assets]
- Swagger-Editor version: [e.g. 3.10.0]
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]
n/a
Content & configuration
n/a
Describe the bug you're encountering
FAIL test/unit/plugins/validate-semantic/2and3/paths.js
● validation plugin - semantic - 2and3 paths › Path parameter definitions need matching paramater declarations › OpenAPI 3 › should return one problem for a path parameter defined at the operation level that is not present within every operation on the path
expect(received).toEqual(expected) // deep equality
Expected: 1
Received: 0
189 | const allErrors = system.errSelectors.allErrors().toJS();
190 | const firstError = allErrors[0];
> 191 | expect(allErrors.length).toEqual(1);
| ^
192 | expect(firstError.message).toEqual( 'Declared path parameter \"id\" needs to be defined within every operation in the path (missing in "post", "delete"), or moved to the path-level parameters object');
193 | expect(firstError.path).toEqual(['paths', '/CoolPath/{id}']);
194 | });
at then.system (test/unit/plugins/validate-semantic/2and3/paths.js:191:40)
To reproduce...
This is an intermittent failure on NodeCI and Jenkins jobs, anedoctally, less than 5% of runs. On a spot check basis, I've not seen this fail locally.
Expected behavior
This test should reliably pass.