c289a6fc34 | ||
---|---|---|
.. | ||
README.md | ||
accessTerminatedPoolAttributes.js | ||
autoCommit.js | ||
autoCommitForSelect.js | ||
binding.js | ||
columnMetadata.js | ||
connection.js | ||
dataTypeAssist.js | ||
dataTypeBinaryDouble.js | ||
dataTypeBinaryFloat.js | ||
dataTypeChar.js | ||
dataTypeDate.js | ||
dataTypeFloat.js | ||
dataTypeFloat2.js | ||
dataTypeNchar.js | ||
dataTypeNumber.js | ||
dataTypeNumber2.js | ||
dataTypeNvarchar2.js | ||
dataTypeTimestamp1.js | ||
dataTypeTimestamp2.js | ||
dataTypeTimestamp3.js | ||
dataTypeTimestamp4.js | ||
dataTypeTimestamp5.js | ||
dataTypeTimestamp6.js | ||
dataTypeVarchar2.js | ||
dbConfig.js | ||
dmlReturning.js | ||
examples.js | ||
externalAuthentication.js | ||
getConnAfterPoolTerminate.js | ||
nullColumnValues.js | ||
pool.js | ||
poolTimeout.js | ||
poolValidityAfterFailingTerminate.js | ||
releaseAfterFailingTerminate.js | ||
resultSet1.js | ||
resultSet2.js |
README.md
Testing node-oracledb
Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
You may not use the identified files except in compliance with the Apache License, Version 2.0 (the "License.")
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
The node-oracledb test suite uses 'mocha', 'should' and 'async'. See LICENSE.md for relevant licenses.
Running the complete test suite
1. Create a working directory
mkdir <some-directory>
cd <some-directory>
2. Install node-oracledb
See INSTALL for installation requirements and more details.
Install with:
npm install oracledb
Alternatively use a GitHub clone:
git clone https://github.com/oracle/node-oracledb.git
npm install node-oracledb
3. Install dependent modules
The test suite uses mocha, async and should. These need to be installed separately.
cd <some-directory>/node_modules/oracledb
npm install mocha should async
Note: these are listed in devDependencies
in package.json
so npm install
will install them when executed inside a node-oracledb
package directory.
4. Edit database credentials
vi <some-directory>/node_modules/oracledb/test/dbConfig.js
Change the credentials to a user who has privileges to connect and create tables:
module.exports = {
user : "hr",
password : "welcome",
connectString : "localhost/orcl",
externalAuth : false
};
To use external authentication, set the externalAuth
property to
true
. Also make sure Oracle Database and the authentication service
have been appropriately configured. See
Documentation for External Authentication
for more details.
5. Run test suite
All tests can be run with:
cd <some-directory>/node_modules/oracledb
npm test
This calls the test
script defined in <some-directory>/node_modules/oracledb/package.json
.
If mocha
is not in the directory specified in package.json
, for example if you have installed it globally, then edit package.json
and change the path.
Running a single test
Individual tests can be run using:
cd <some-directory>/node_modules/oracledb
../mocha/bin/mocha test/<test-name>
See mochajs.org for more information on running tests with mocha.
Adding Tests
See CONTRIBUTING for general information on contribution requirements.
For easy correlation between results and test code, each test is assigned a number. The following number ranges have been chosen:
- 1 - 20 are reserved for basic functional tests
- 21 - 50 are reserved for data type supporting tests
- 51 onwards are for other tests