node-oracledb/test
Christopher Jones 0448cdc210 Retrieval of LONGS is now supported so test will need to be updated 2017-06-14 09:30:28 +10:00
..
.editorconfig Add test editorconfig 2016-05-16 09:35:54 +10:00
README.md Update test/README.md 2016-05-16 09:59:26 +10:00
accessTerminatedPoolAttributes.js Make error.message.should.startWith usage consistent for NJS errors in tests 2016-05-18 16:24:17 +10:00
autoCommit.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
autoCommit4nestedExecutes.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
autoCommitForSelect.js Add ORDER BYs to test queries for better portability 2016-07-08 16:58:37 +10:00
binding.js Test does not need to be skipped 2017-06-14 09:25:48 +10:00
checkClassesTypes.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
clobPlsqlString.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
clobexample.txt Update URL to reflect changed OTN hierarchy 2015-11-15 08:28:11 +11:00
columnMetadata.js Add ORDER BYs to test queries for better portability 2016-07-08 16:58:37 +10:00
connection.js Add ORDER BYs to test queries for better portability 2016-07-08 16:58:37 +10:00
dataTypeAssist.js Add ORDER BYs to test queries for better portability 2016-07-08 16:58:37 +10:00
dataTypeBinaryDouble.js Test updates 2017-06-14 08:16:22 +10:00
dataTypeBinaryFloat.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeBlob.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeChar.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeClob.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeDate.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeFloat.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeFloat2.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeNchar.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeNumber.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeNumber2.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeNvarchar2.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeRaw.js Make error.message.should.startWith usage consistent for NJS errors in tests 2016-05-18 16:24:17 +10:00
dataTypeRowid.js Indicate new functionality in tests 2017-06-14 08:23:02 +10:00
dataTypeTimestamp1.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
dataTypeTimestamp2.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeTimestamp3.js Indicate new functionality in tests 2017-06-14 08:23:02 +10:00
dataTypeTimestamp4.js Test updates 2017-06-14 08:16:22 +10:00
dataTypeTimestamp5.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeTimestamp6.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dataTypeVarchar2.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dbconfig.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
dmlReturning.js Make error.message.should.startWith usage consistent for NJS errors in tests 2016-05-18 16:24:17 +10:00
examples.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
extendedMetaData.js Retrieval of LONGS is now supported so test will need to be updated 2017-06-14 09:30:28 +10:00
externalAuthentication.js Different error number raised for case where username/password is set while attempting external authentication. 2017-06-14 08:18:11 +10:00
fetchAs.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
fuzzydinosaur.jpg Update tests for new functionality 2015-08-17 16:19:36 +10:00
getConnAfterPoolTerminate.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
instanceof.js Allow instanceof.js and writableProperties.js to be run when located outside the git clone 2016-05-17 16:10:27 +10:00
list.txt Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
lobProperties.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
lobResultSet.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
nestedCursor.js Comment result output 2017-06-14 09:06:05 +10:00
nullColumnValues.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
plsqlBinding1.js Make error.message.should.startWith usage consistent for NJS errors in tests 2016-05-18 16:24:17 +10:00
plsqlBinding2.js Make error.message.should.startWith usage consistent for NJS errors in tests 2016-05-18 16:24:17 +10:00
pool.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
poolTimeout.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
poolValidityAfterFailingTerminate.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
promises.js Merge 1.9.0-dev JavaScript changes adding Promises etc 2016-05-16 09:53:23 +10:00
properties.js Merged from master. Most of these changes are for extended metadata support 2017-06-14 08:38:08 +10:00
releaseAfterFailingTerminate.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
resultSet1.js Arguments are checked BEFORE the asynchronous method is executed and an exception raised, rather than passed through to the callback. 2017-06-14 08:17:07 +10:00
resultSet2.js Update to latest version of ODPI-C; invalid ref cursor is determined earlier than in v1 so accommodate those changes 2017-06-14 09:07:27 +10:00
resultsetToStream.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
sqlWithWarnings.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
stream1.js Add another stream metadata event test 2016-07-08 16:52:21 +10:00
stream2.js Add another stream metadata event test 2016-07-08 16:52:21 +10:00
uninitializedLob.js Preserve original creation year in copyright 2016-05-17 17:20:37 +10:00
utf8MultibyteCharacter.js Add tests using utf-8 multibyte characters 2016-07-08 16:57:48 +10:00
writableProperties.js Allow instanceof.js and writableProperties.js to be run when located outside the git clone 2016-05-17 16:10:27 +10:00

README.md

Test node-oracledb

Copyright (c) 2015, 2016, 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 for relevant licenses.

1. Preparations for running tests

See INSTALL for installation requirements and more details.

Note: the test suite is in GitHub. From node-oracledb 1.9.1 it is not included when installing from npmjs.com with npm install oracledb.

1.1 Create a working directory

mkdir <some-directory>
cd <some-directory>

1.2 Get node-oracledb from GitHub

Clone the project repository:

cd <some-directory>
git clone https://github.com/oracle/node-oracledb.git

1.3 Build

cd <some-directory>/node-oracledb
npm install

Running npm install within the node-oracledb/ directory will recompile oracledb and install all its dependent modules. These are listed in the devDependencies field of package.json file. Thus, 'mocha', 'async' and 'should' modules are installed by this command.

The test suite uses mocha, async and should.

1.4 Configure Database credentials

The database credentials for node-oracledb test suite are defined in dbconfig.js. They can also be set via environment variables shown in that file.

vi <some-directory>/node-oracledb/test/dbconfig.js
module.exports = {
  user          : process.env.NODE_ORACLEDB_USER || "hr",
  password      : process.env.NODE_ORACLEDB_PASSWORD || "welcome",
  connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl",
  externalAuth  : process.env.NODE_ORACLEDB_EXTERNALAUTH ? true : 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.

Note: the test suite requires a schema with these privileges:

  • CREATE TABLE
  • CREATE SESSION
  • CREATE PROCEDURE
  • CREATE SEQUENCE
  • CREATE TRIGGER

1.5 Set NODE_PATH

export NODE_PATH=<some-directory>/node-oracledb/lib

2. Run tests

2.1 Run the complete test suite

2.1.1 On Unix-like systems

cd <some-directory>/node-oracledb
npm test

This calls the test script defined in oracledb/package.json.

2.1.2 On Windows

cd <some-directory>/node_oracledb
npm run-script testWindows

This calls the testWindows script defined in oracledb/package.json.

See npm scripts for more information about how npm handles the "scripts" field of package.json.

2.2 Run specified test(s)

cd <some-directory>/node_oracledb
<mocha-executable-file-directory>/mocha test/<test-names>

See mochajs.org for more information on running tests with mocha.

3. Add 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

4. Test Index

See test/list.txt for the list of existing tests.