|
| 1 | +--- |
| 2 | +name: Bug report |
| 3 | +about: Something isn't working with the app |
| 4 | +title: "[BUG]" |
| 5 | +labels: bug |
| 6 | +assignees: duncdrum |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +> To be able to better understand you problem, please add as much information as possible to this ticket. Always test your bugs against the latest version of the documentation app that ships with the last stable release of exist-db. We cannot provide support for older versions here on GitHub. |
| 11 | +
|
| 12 | +**Describe the bug** |
| 13 | +A clear and concise description of what the bug is. |
| 14 | + |
| 15 | +**Expected behavior** |
| 16 | +A clear and concise description of what you expected to happen. |
| 17 | + |
| 18 | +**To Reproduce** |
| 19 | +> The *best* way is to provide an [SSCCE (Short, Self Contained, Correct (Compilable), Example)](http://sscce.org/). One type of SSCCE could be a small test which reproduces the issue and can be run without dependencies. |
| 20 | +
|
| 21 | +To run unit tests locally: `mvn test` |
| 22 | + |
| 23 | +**Unit Test** |
| 24 | +[XQSuite - Annotation-based Test Framework for XQuery](http://exist-db.org/exist/apps/doc/xqsuite.xml) unit tests for xquery code are located at `src/main/xar-resources/modules/test-suite.xql`. |
| 25 | +```Xquery |
| 26 | +xquery version "3.1"; |
| 27 | +
|
| 28 | +module namespace t="http://exist-db.org/xquery/test"; |
| 29 | +declare namespace test="http://exist-db.org/xquery/xqsuite"; |
| 30 | +
|
| 31 | +<-- Adjust to your reported issue --> |
| 32 | +declare |
| 33 | + %test:assertTrue |
| 34 | +function t:test() { |
| 35 | + 1 eq 1 |
| 36 | +}; |
| 37 | +``` |
| 38 | + |
| 39 | +[mocha](https://mochajs.org) unit tests for javascript are located at `src/test/mocha/test.js` |
| 40 | + |
| 41 | +```javascript |
| 42 | +const assert = require('assert') |
| 43 | + |
| 44 | +// this is a dummy test |
| 45 | +describe('Array', function () { |
| 46 | + describe('#indexOf()', function () { |
| 47 | + it('should return -1 when the value is not present', function () { |
| 48 | + assert.strictEqual([1, 2, 3].indexOf(4), -1) |
| 49 | + }) |
| 50 | + }) |
| 51 | +}) |
| 52 | +``` |
| 53 | + |
| 54 | +**Integration Test** |
| 55 | +For UI and browser based testing we use [cypress.js](https://www.cypress.io). The tests are located at `src/test/cypress/integration/documentation_spec.js`. |
| 56 | +To run this locally: `cypress open` |
| 57 | + |
| 58 | +```javascript |
| 59 | +// adjust as necessary |
| 60 | +describe('The app', function() { |
| 61 | + it('should load', function() { |
| 62 | + // Go to app start page |
| 63 | + cy.visit('/app/index.html') |
| 64 | + }) |
| 65 | +``` |
| 66 | +
|
| 67 | +If none of the above is working, please tell us the exact steps you took when you encountered the problem: |
| 68 | +1. Go to '...' |
| 69 | +2. Click on '....' |
| 70 | +3. Scroll down to '....' |
| 71 | +4. See error |
| 72 | +
|
| 73 | +**Screenshots** |
| 74 | +If applicable, add screenshots to help explain your problem. |
| 75 | +
|
| 76 | +**Context (please always complete the following information):** |
| 77 | +- eXist-db Version: [e.g. 5.1.1] |
| 78 | +- App Version: [e.g. 5.1.0] |
| 79 | +- Browser Version: [e.g. Safari 13.0.4] |
0 commit comments