1
- /* Copyright (c) 2018, 2019 , Oracle and/or its affiliates. All rights reserved. */
1
+ /* Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved. */
2
2
3
3
/******************************************************************************
4
4
*
15
15
* See the License for the specific language governing permissions and
16
16
* limitations under the License.
17
17
*
18
- * The node-oracledb test suite uses 'mocha', 'should' and 'async' .
18
+ * The node-oracledb test suite uses 'mocha'.
19
19
* See LICENSE.md for relevant licenses.
20
20
*
21
21
* NAME
29
29
30
30
31
31
const oracledb = require ( 'oracledb' ) ;
32
- const should = require ( 'should ' ) ;
32
+ const assert = require ( 'assert ' ) ;
33
33
const dbconfig = require ( './dbconfig.js' ) ;
34
34
35
35
describe ( '223. accessPropertiesOnClosedObjects.js' , ( ) => {
36
36
37
37
it ( '223.1 access properties of closed Connection object' , async ( ) => {
38
38
try {
39
39
const conn = await oracledb . getConnection ( dbconfig ) ;
40
+ assert ( conn ) ;
40
41
await conn . close ( ) ;
41
42
42
- let closedObjProp = conn . oracleServerVersion ;
43
- should . not . exist ( closedObjProp ) ;
43
+ const closedObjProp = conn . oracleServerVersion ;
44
+ assert . ifError ( closedObjProp ) ;
44
45
} catch ( err ) {
45
- should . not . exist ( err ) ;
46
+ assert . fail ( err ) ;
46
47
}
47
48
} ) ; // 223.1
48
49
@@ -53,14 +54,14 @@ describe('223. accessPropertiesOnClosedObjects.js', () => {
53
54
const Lob = await conn . createLob ( oracledb . DB_TYPE_BLOB ) ;
54
55
55
56
await Lob . close ( ) ;
56
- should . strictEqual ( Lob . type , oracledb . DB_TYPE_BLOB ) ;
57
- should . strictEqual ( Lob . length , 0 ) ;
57
+ assert . strictEqual ( Lob . type , oracledb . DB_TYPE_BLOB ) ;
58
+ assert . strictEqual ( Lob . length , 0 ) ;
58
59
59
60
await conn . close ( ) ;
60
- should . strictEqual ( Lob . type , oracledb . DB_TYPE_BLOB ) ;
61
- should . strictEqual ( Lob . length , 0 ) ;
61
+ assert . strictEqual ( Lob . type , oracledb . DB_TYPE_BLOB ) ;
62
+ assert . strictEqual ( Lob . length , 0 ) ;
62
63
} catch ( err ) {
63
- should . not . exist ( err ) ;
64
+ assert . fail ( err ) ;
64
65
}
65
66
} ) ; // 223.2
66
67
} ) ;
0 commit comments