diff --git a/spec/tests/app.js b/spec/tests/app.js index 26df05a..d72935a 100644 --- a/spec/tests/app.js +++ b/spec/tests/app.js @@ -68,7 +68,10 @@ await describe('empty application XAR', async () => { await it('install app', async () => { const response = await db.app.install(xarName) assert.strictEqual(response.success, false) - assert.strictEqual(response.error.message, `experr:EXPATH00 Missing descriptor from package: ${app.packageCollection}/test-empty-app.xar`) + const { message } = response.error + // eXist-db 7 reports EXPATH007 and prefixes the description + assert.ok(message.startsWith('experr:EXPATH00'), message) + assert.ok(message.endsWith(`Missing descriptor from package: ${app.packageCollection}/test-empty-app.xar`), message) }) await it('cleanup', async () => { diff --git a/spec/tests/documents.js b/spec/tests/documents.js index 1027bbd..b4ede96 100644 --- a/spec/tests/documents.js +++ b/spec/tests/documents.js @@ -52,6 +52,12 @@ await describe('valid XML', async function () { const remoteFileName = '/test.xml' const contents = readFileSync('spec/files/test.xml') + // eXist-db 7 keeps the XML declaration stored with a document unless the + // custom omit-original-xml-declaration is set, omit-xml-declaration alone + // does not remove it. Pending https://github.com/eXist-db/exist/pull/6277 + const storedDeclarationKept = parseInt(version, 10) >= 7 && + 'eXist-db 7 keeps the stored XML declaration, see eXist-db/exist#6277' + await it('can be uploaded', async function () { try { const fh = await db.documents.upload(contents) @@ -65,7 +71,7 @@ await describe('valid XML', async function () { } }) - await it('read with empty options uses defaults', async function () { + await it('read with empty options uses defaults', { todo: storedDeclarationKept }, async function () { try { const contentBuffer = await db.documents.read(remoteFileName, {}) const lines = contents.toString().split('\n') @@ -83,7 +89,7 @@ await describe('valid XML', async function () { } }) - await it('read without passing options', async function () { + await it('read without passing options', { todo: storedDeclarationKept }, async function () { try { // calling read with just one argument, effectively passing null for options const contentBuffer = await db.documents.read(remoteFileName) @@ -102,7 +108,7 @@ await describe('valid XML', async function () { } }) - await it('serialized without XML declaration', async function () { + await it('serialized without XML declaration', { todo: storedDeclarationKept }, async function () { try { const options = { 'omit-xml-declaration': 'yes' } const lines = contents.toString().split('\n') diff --git a/spec/tests/rest.js b/spec/tests/rest.js index 74a8b6e..dce0aaf 100644 --- a/spec/tests/rest.js +++ b/spec/tests/rest.js @@ -273,7 +273,12 @@ return $r } }) - await it('post honors start and max', async function () { + // eXist-db 7.0.0-SNAPSHOT ignores the start and max attributes of a posted query + // https://github.com/eXist-db/exist/issues/6560 + const paginationIgnored = parseInt(await db.server.version(), 10) >= 7 && + 'eXist-db 7 ignores start and max, see eXist-db/exist#6560' + + await it('post honors start and max', { todo: paginationIgnored }, async function () { try { const res = await rc.post(xqueryMainModule, 'db/rest-test', { start: 1, max: 1 }) assert.strictEqual(res.statusCode, 200, 'server responded with status ' + res.statusCode) @@ -290,7 +295,7 @@ return $r } }) - await it('post honors just start', async function () { + await it('post honors just start', { todo: paginationIgnored }, async function () { try { const res = await rc.post(xqueryMainModule, 'db/rest-test', { start: 2 }) assert.strictEqual(res.statusCode, 200, 'server responded with status ' + res.statusCode) @@ -306,7 +311,7 @@ return $r } }) - await it('post honors cache', async function () { + await it('post honors cache', { todo: paginationIgnored }, async function () { try { const res = await rc.post(xqueryMainModule, 'db/rest-test', { cache: 'yes', start: 1, max: 1 }) assert.strictEqual(res.statusCode, 200, 'server responded with status ' + res.statusCode)