|
| 1 | +/* Copyright (c) 2023, Oracle and/or its affiliates. */ |
| 2 | + |
| 3 | +/****************************************************************************** |
| 4 | + * |
| 5 | + * This software is dual-licensed to you under the Universal Permissive License |
| 6 | + * (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License |
| 7 | + * 2.0 as shown at https://www.apache.org/licenses/LICENSE-2.0. You may choose |
| 8 | + * either license. |
| 9 | + * |
| 10 | + * If you elect to accept the software under the Apache License, Version 2.0, |
| 11 | + * the following applies: |
| 12 | + * |
| 13 | + * Licensed under the Apache License, Version 2.0 (the `License`); |
| 14 | + * you may not use this file except in compliance with the License. |
| 15 | + * You may obtain a copy of the License at |
| 16 | + * |
| 17 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 18 | + * |
| 19 | + * Unless required by applicable law or agreed to in writing, software |
| 20 | + * distributed under the License is distributed on an `AS IS` BASIS, |
| 21 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | + * See the License for the specific language governing permissions and |
| 23 | + * limitations under the License. |
| 24 | + * |
| 25 | + * NAME |
| 26 | + * 284. errorUrl.js |
| 27 | + * |
| 28 | + * DESCRIPTION |
| 29 | + * This test verifies enhancement to expose error portal URL in error message |
| 30 | + * |
| 31 | + *****************************************************************************/ |
| 32 | +'use strict'; |
| 33 | + |
| 34 | +const oracledb = require('oracledb'); |
| 35 | +const assert = require('assert'); |
| 36 | +const dbConfig = require('./dbconfig.js'); |
| 37 | +const testsUtil = require('./testsUtil.js'); |
| 38 | + |
| 39 | +describe('284. errorUrl.js', function() { |
| 40 | + |
| 41 | + let conn; |
| 42 | + before(async function() { |
| 43 | + conn = await oracledb.getConnection(dbConfig); |
| 44 | + if (testsUtil.getClientVersion() < 2301000000) { |
| 45 | + this.skip(); |
| 46 | + } |
| 47 | + }); |
| 48 | + |
| 49 | + after(async () => { |
| 50 | + await conn.close(); |
| 51 | + }); |
| 52 | + |
| 53 | + it('284.1 checks for error URL in ORA error message', async () => { |
| 54 | + const url = /https:\/\/docs.oracle.com\/error-help\/db\/ora-01476\//; |
| 55 | + await assert.rejects( |
| 56 | + async () => await conn.execute(`SELECT 1/0 FROM DUAL`), |
| 57 | + (err) => { |
| 58 | + assert.match(err.message, url); |
| 59 | + return true; |
| 60 | + } |
| 61 | + ); |
| 62 | + }); // 284.1 |
| 63 | + |
| 64 | +}); |
0 commit comments