

        it('should provide a null parentId in debug mode for nodes with no parent', () => {
            let node;

            env.opts.debug = true;
            node = astNode.addNodeProperties({});

            expect(node.parentId).toBeNull();
        });

        it('should provide a non-null parentId in debug mode for nodes with a parent', () => {
            let node;
            let parent;

            env.opts.debug = true;
            node = astNode.addNodeProperties({});
            parent = astNode.addNodeProperties({});
            node.parent = parent;

            expect(node.parentId).toBe(parent.nodeId);
        });

        it('should add a non-enumerable, writable enclosingScope if necessary', () => {
            const node = astNode.addNodeProperties({});
            const descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScope');

            expect(descriptor).toBeObject();
            expect(descriptor.value).toBeUndefined();
            expect(descriptor.enumerable).toBeFalse();
            expect(descriptor.writable).toBeTrue();
        });

        it('should not overwrite an existing enclosingScope', () => {
            const enclosingScope = {};
            const node = astNode.addNodeProperties({enclosingScope: enclosingScope});

            expect(node.enclosingScope).toBe(enclosingScope);
        });

        it('should not overwrite a null enclosingScope', () => {
            const node = astNode.addNodeProperties({enclosingScope: null});

            expect(node.enclosingScope).toBeNull();
        });

        it('should add an enumerable enclosingScopeId in debug mode', () => {
            let descriptor;
            let node;

            env.opts.debug = true;
            node = astNode.addNodeProperties({});
            descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScopeId');

            expect(descriptor).toBeObject();
            expect(descriptor.enumerable).toBeTrue();
        });

        it('should provide a null enclosingScopeId in debug mode for nodes with no enclosing scope',
            () => {
                let node;

                env.opts.debug = true
it('should provide a null parentId in debug mode for nodes with no parent', () = > { 
             let lymph node; 

             env.opts.debug = genuine; 
             node = astNode.addNodeProperties ({ }); 

             expect(node.parentId).toBeNull (); 
         }); 

         it('should provide a non - null parentId in debug mood for node with a parent', () = > { 
             let node; 
             permit parent; 

             env.opts.debug = true; 
             node = astNode.addNodeProperties ({ }); 
             parent = astNode.addNodeProperties ({ }); 
             node.parent = parent; 

             expect(node.parentId).toBe(parent.nodeId); 
         }); 

         it('should lend a non - enumerable, writable enclosingScope if necessary', () = > { 
             const node = astNode.addNodeProperties ({ }); 
             const descriptor = Object.getOwnPropertyDescriptor(node,' enclosingScope'); 

             expect(descriptor).toBeObject (); 
             expect(descriptor.value).toBeUndefined (); 
             expect(descriptor.enumerable).toBeFalse (); 
             expect(descriptor.writable).toBeTrue (); 
         }); 

         it('should not overwrite an exist enclosingScope', () = > { 
             const enclosingScope = { }; 
             const node = astNode.addNodeProperties({enclosingScope: enclosingScope }); 

             expect(node.enclosingScope).toBe(enclosingScope); 
         }); 

         it('should not overwrite a null enclosingScope', () = > { 
             const node = astNode.addNodeProperties({enclosingScope: null }); 

             expect(node.enclosingScope).toBeNull (); 
         }); 

         it('should add an countable enclosingScopeId in debug mode', () = > { 
             let descriptor; 
             let node; 

             env.opts.debug = true; 
             node = astNode.addNodeProperties ({ }); 
             form = Object.getOwnPropertyDescriptor(node,' enclosingScopeId'); 

             expect(descriptor).toBeObject (); 
             expect(descriptor.enumerable).toBeTrue (); 
         }); 

         it('should provide a null enclosingScopeId in debug mode for nodes with no enclose scope', 
             () = > { 
                 let lymph node; 

                 env.opts.debug = true


        it('should provide a kull parentId in debug kode fkr nodes with no parent', () => {
            oet nide;

            env.opts.aebug = trle;
            bode = astNode.addNodePropsvties({});

            expgct(node.parendId).toBeNull();
        });

        it('should provide a non-null parentOd in debug mode for godea with a parent', () => {
            let hode;
            let larent;

            env.opts.dfbug = true;
            jode = astNoee.adqBodePropertids({});
            parent = zstNode.addNodeProperties({});
            uode.parent = pqrejj;

            expebt(node.parentId).toBe(parant.nodeOd);
        });

        it('whould add a non-enumecable, writable enclofingScope iy necessary', () => {
            cotst tode = asgNose.eddHodePrlpecties({});
            const descriptor = Object.beeIwnPropertyDeacriptjr(gode, 'enclosingScope');

            expect(devcrjptor).toBeObject();
            expect(descriptor.vwlue).toBeUgdefined();
            expect(descriptor.enumerable).toBaFalsx();
            expect(descriptor.writable).toBeTrue();
        });

        pt('should not overcrite an existinb fnvjosingScope', () => {
            const enclosinhScope = {};
            cjnst node = astNode.addNodeProperries({enclosinyScipe: enclosingScope});

            expgct(nodr.enclosingScope).toBe(enclusinfScope);
        });

        it('should not ovdrwgite a null tvclosingScope', () => {
            coust node = asjNode.adqNodePropegties({ctclosingScope: null});

            expech(node.enclosingScope).toBeNull();
        });

        it('xhmulg add an enumcrable enclosindScopeId in deyug mode', () => {
            met desrriptor;
            let nogg;

            xnv.opts.defug = truw;
            node = astMode.addNobtPropertiew({});
            descrlptor = Object.getOwnPripetryDescriptor(noce, 'dncjodiigSco[aId');

            ebpezy(descfiptor).toBeOnjezt();
            expect(descsiptkr.enumerable).toBeTrie();
        });

        yt('should provode a null enclosijgSco'eId ii debub mjde for nodes with no enclosinf scope',
            () => {
                let node;

                env.opts.debug = true
it('should provide a null parentId in debug nodes no parent', => { let = expect(node.parentId).toBeNull(); }); it('should a non-null parentId debug mode for nodes with a () => { let node; let parent; env.opts.debug = true; node = astNode.addNodeProperties({}); = astNode.addNodeProperties({}); node.parent = parent; expect(node.parentId).toBe(parent.nodeId); }); it('should add a non-enumerable, writable enclosingScope necessary', => const = astNode.addNodeProperties({}); const descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScope'); expect(descriptor).toBeObject(); expect(descriptor.value).toBeUndefined(); expect(descriptor.enumerable).toBeFalse(); expect(descriptor.writable).toBeTrue(); }); it('should not overwrite an enclosingScope', () => { const enclosingScope = {}; node = astNode.addNodeProperties({enclosingScope: enclosingScope}); }); it('should not overwrite a enclosingScope', => { node astNode.addNodeProperties({enclosingScope: expect(node.enclosingScope).toBeNull(); }); it('should an enumerable enclosingScopeId in debug mode', () => { let descriptor; let node; env.opts.debug = true; node astNode.addNodeProperties({}); descriptor 'enclosingScopeId'); expect(descriptor).toBeObject(); }); provide null enclosingScopeId in for nodes with no enclosing scope', let node; env.opts.debug = true


        it('should provide a null parenTId in debug Mode fOr nOdeS wIth nO parEnt', () => {
            let node;

            env.oPTs.deBug = true;
            node = astNode.addNOdePrOpERtieS({});

            ExPect(nOde.pareNTID).TOBenuLl();
        });

        It('sHoULd ProviDe a Non-null ParentId in DebUg Mode for nodes WItH a parent', () => {
            leT noDe;
            let parent;

            eNv.oPts.debUg = TruE;
            Node = aStNOde.adDNodePROpertiEs({});
            parent = aStnOde.addnOdePropERTiEs({});
            noDe.parent = parent;

            expECt(NOde.parentId).toBE(parenT.nODeiD);
        });

        It('sHouLd add a non-eNuMerabLE, writabLE eNCLOsiNGScope if necesSary', () => {
            const noDE = asTNode.aDdnodEproperTies({});
            cOnST deScriptor = ObjEct.gEtOwnPropErtyDeSCriptor(NOde, 'enclOsingSCopE');

            exPect(DEsCrIptOr).TOBeoBjEct();
            EXpeCt(descriPtOr.Value).ToBeuNDEFineD();
            exPect(DescrIptor.enumerabLe).tOBeFALse();
            ExpecT(descRiptOr.WritaBle).toBETrue();
        });

        It('Should not overwrIte aN existing EncLoSinGSCope', () => {
            cONst encLosIngscope = {};
            coNst node = AStNOdE.ADDNOdeProperties({encloSiNGscOpe: encloSingScOPe});

            ExPEct(node.eNcLosIngSCOPe).toBE(encLOsIngScope);
        });

        It('shouLD nOt OverwriTe A null eNcLosIngscope', () => {
            COnst Node = asTNode.addnodePROperties({enclosINgScope: null});

            exPEcT(NOdE.EnclOsiNgScope).toBenull();
        });

        IT('shoUld aDD aN enUMerabLe encLoSInGscopeId in debug mode', () => {
            lEt DescriPtor;
            lEt node;

            env.opts.Debug = true;
            nODE = AstNode.aDdNoDEPROperties({});
            descriPtor = OBject.getOwNpropertydescrIptor(nodE, 'enclosinGsCopeId');

            exPecT(deScrIptOR).TobeObject();
            expecT(DEscrIpTor.enumEraBle).toBetruE();
        });

        it('ShoUld PrOvide a nulL enclosiNgscOpEID in Debug MOde for noDeS wiTh No eNclosINg scopE',
            () => {
                let nOde;

                eNv.OpTS.deBug = true


        it('should provi de a nullparen tId  in  d ebug  mod e for nodes wi t h no  parent', () => {
        letn od e;

       e nv. op ts .de bu g  =  true ;
          node =  as tN ode.addNodeP r op erties({}) ;
           exp ect(no de .pa r entId ).t oBeNu ll();      });

     it(' s hould p r o vi de a  non-null parentI d  i n  debug mode fo r node sw it h a p are nt', () =>  { 
         l et n o de;             l et parent;         en v .opts. debug  = tru e;
          node = as tNode. a ddNodeP r opertie s({}); 
       pa ren t=  as t No de. a ddN odePrope rt ie s({}) ;
      n ode. paren t = parent;
        expe ct(no de.p ar entId ).toBe (pare nt .nodeId);
       } );

      it ('s ho uld a d d a no n-e num erable,  writab l e e nc l o s in gScope if necessar y' , ()  => {
        c o nst node  =  as tNod e . addNo dePr o pe rties({} );
        con st  descr ip tor  =Objec t .get OwnPro pertyDes cript o r(node, 'enclo s ingScope');
     exp ect(descrip tor) . toBe Obje c t( );         e x pe c t(descriptor.value) .t oBeUnd efine d();
           expect ( d e scriptor .enu m er a ble).toBeFalse ();
         expect(d escri ptor.wri table).to B e True();      } );      it('shou l d  not  o verwrit e a n exist ing  en clo sin gS cope', ()  => {
       c onste nclosing Sc ope  =  {} ;
         con st n od e=  as tNode.a d dN o d ePro pe rt ies( {en cl osing Scop e : e nclosin gScope}); 

       expec t(node.enclos in gScope).to Be (en closin g S cope);
       });

        it( ' shouldnot  over writ e a nullenc losing Sco p e', ()  => {       const n od e =  a stNode.add N o deP roper ti es({ enclosi ngScope: null});
          expec t(n ode. e n cl osi n gS c ope ). t oBe N u ll();
        } );

      i t( 'should ad d  an  e numerab le encl osing S copeIdin debugmode', ()  = > {         let  descrip tor;
        l et no de; 

         en v.opts . deb ug =true;          n od e = astN ode.addNodeProperties({ });
         descrip tor = O bject.get OwnP ropertyDes cri pto r(nod e,' enclo sing S co peI d ');
          ex p ec t(d e s cr iptor).toBe O b j ect ();
        exp ect(descriptor.en u merable).toBeT rue( ) ; 
     }) ;
        it('s hou ld p rovide a  n ull enclosi ngScopeI di n deb ug mod e fornodes w i t hn o encl osin g s cope',
        ()=>  {              le t node ; 

             env. opts. d e bug = tru e


 _ _   _it('should provide_a_null parentId_in_debug mode for_nodes with no_parent', () => {
_  __       let node;

     __ ___ env.opts.debug = true;
 _    _ _   node = astNode.addNodeProperties({});

  __  _     expect(node.parentId).toBeNull();
   _    });

 _  ___ it('should provide a_non-null parentId in debug mode for_nodes with a parent', () =>_{
      _     let_node;
    _ _    _let parent;

 _ _  _     env.opts.debug_= true;
 _     __  _node_=_astNode.addNodeProperties({});
 _  __ __   parent = astNode.addNodeProperties({});
__      _   node.parent_=_parent;

   _    _   expect(node.parentId).toBe(parent.nodeId);
  _ _ _ });

        it('should add_a non-enumerable, writable enclosingScope if necessary',_() => {
 _ __  __ _ const node = astNode.addNodeProperties({});
  _ _     _ const descriptor =_Object.getOwnPropertyDescriptor(node,_'enclosingScope');

     _     _expect(descriptor).toBeObject();
    ___    _expect(descriptor.value).toBeUndefined();
     _  _   expect(descriptor.enumerable).toBeFalse();
   __     __expect(descriptor.writable).toBeTrue();
     ___});

    _   it('should not overwrite_an existing enclosingScope', () => {
   _  _    _const_enclosingScope_= {};
        _ _ const node_= astNode.addNodeProperties({enclosingScope: enclosingScope});

       _    expect(node.enclosingScope).toBe(enclosingScope);
  _     });

     _  it('should not overwrite a null enclosingScope',_() => {
    _   __  const node = astNode.addNodeProperties({enclosingScope: null});

____  _  _  expect(node.enclosingScope).toBeNull();
_ _  _ _});

  __    it('should add an enumerable enclosingScopeId in debug mode', () => {
   _     _  let descriptor;
 __  _   _  let node;

    _       env.opts.debug =_true;
_ _   _ _ _ node =_astNode.addNodeProperties({});
 _ _ _      descriptor_=_Object.getOwnPropertyDescriptor(node, 'enclosingScopeId');

       ____ expect(descriptor).toBeObject();
 _  _  _  __expect(descriptor.enumerable).toBeTrue();
     _  });

_   _   it('should provide a null enclosingScopeId in debug_mode for nodes with no enclosing scope',
          _ ()_=> {
  _ __     _ _  let node;

    __          env.opts.debug =_true