@@ -10,14 +10,22 @@ describe('[HDLX] HDSLib.index.js', () => {
1010 it ( '[HDME] HDSLib.model throws error if not initialized' , ( ) => {
1111 try {
1212 // eslint-disable-next-line no-unused-expressions
13- HDSLib . model ;
13+ HDSLib . model . modelData ;
1414 throw new Error ( 'Should throw an error' ) ;
1515 } catch ( e ) {
16- assert . equal ( e . message , 'Call await HDSLib.initHDSModel() once' ) ;
16+ assert . equal ( e . message , 'Model not loaded call `HDSLib.initHDSModel()` or `await model.load()` first.' ) ;
17+ }
18+
19+ try {
20+ // eslint-disable-next-line no-unused-expressions
21+ HDSLib . model . streams ;
22+ throw new Error ( 'Should throw an error' ) ;
23+ } catch ( e ) {
24+ assert . equal ( e . message , 'Model not loaded call `HDSLib.initHDSModel()` or `await model.load()` first.' ) ;
1725 }
1826 } ) ;
1927
20- it ( '[HDME ] HDSLib.initHDSModel()' , async ( ) => {
28+ it ( '[HDMF ] HDSLib.initHDSModel()' , async ( ) => {
2129 const model0 = await HDSLib . initHDSModel ( ) ;
2230 const model1 = await HDSLib . initHDSModel ( ) ;
2331 assert . equal ( model0 , model1 , 'HDSLib.initHDSModel() should used cached model' ) ;
@@ -26,14 +34,6 @@ describe('[HDLX] HDSLib.index.js', () => {
2634 // -- refresh model
2735 } ) ;
2836
29- it ( '[HDME] HDSLib.initHDSModel(forceRefresh = true) should refresh model' , async ( ) => {
30- const model0 = await HDSLib . initHDSModel ( ) ;
31- const model1 = await HDSLib . initHDSModel ( true ) ;
32- assert . ok ( model0 !== model1 , 'HDSLib.initHDSModel(true) should refresh cached model' ) ;
33- const model2 = HDSLib . model ;
34- assert . equal ( model1 , model2 , 'HDSLib.model should used cached model' ) ;
35- } ) ;
36-
3737 describe ( '[HDUX] Utils' , ( ) => {
3838 it ( '[HDUW] utils.waitUntilFalse' , async function ( ) {
3939 this . timeout ( '1000' ) ;
0 commit comments