Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion spec/tests/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
12 changes: 9 additions & 3 deletions spec/tests/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')
Expand All @@ -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)
Expand All @@ -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')
Expand Down
11 changes: 8 additions & 3 deletions spec/tests/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading