diff --git a/js/common/tests/shell/shell-foxx-manager-install-spec.js b/js/common/tests/shell/shell-foxx-manager-install-spec.js index e9aec8ff3b..47dab8ce18 100644 --- a/js/common/tests/shell/shell-foxx-manager-install-spec.js +++ b/js/common/tests/shell/shell-foxx-manager-install-spec.js @@ -110,13 +110,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'malformed-controller-path'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause').that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); }); @@ -125,11 +120,10 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'broken-controller-file'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_SYNTAX_ERROR.code); if (require('@arangodb').isServer) { - expect(err).to.have.property('cause'); - expect(err.cause).not.to.be.an.instanceof(SyntaxError); - expect(err.cause).not.to.be.an.instanceof(ArangoError); + expect(err).to.have.property('cause') + .that.is.an.instanceof(SyntaxError); } else { expect(err).not.to.have.property('cause'); } @@ -188,14 +182,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'malformed-exports-path'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause') - .that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); }); @@ -219,14 +207,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'malformed-setup-path'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause') - .that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); }); @@ -235,14 +217,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'missing-controller-file'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause') - .that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); }); @@ -251,14 +227,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'missing-exports-file'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause') - .that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); }); @@ -267,14 +237,8 @@ describe('Foxx Manager install', function () { expect(function () { FoxxManager.install(fs.join(basePath, 'missing-setup-file'), '/unittest/broken'); }).to.throw(ArangoError).that.satisfies(function (err) { - expect(err).to.have.property('errorNum', errors.ERROR_MODULE_FAILURE.code); - if (require('@arangodb').isServer) { - expect(err).to.have.property('cause') - .that.is.an.instanceof(ArangoError) - .with.a.property('errorNum', errors.ERROR_SYS_ERROR.code); - } else { - expect(err).not.to.have.property('cause'); - } + expect(err).to.have.property('errorNum', errors.ERROR_MODULE_NOT_FOUND.code); + expect(err).not.to.have.property('cause'); return true; }); });