当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript not.exist方法代码示例

本文整理汇总了TypeScript中should.not.exist方法的典型用法代码示例。如果您正苦于以下问题:TypeScript not.exist方法的具体用法?TypeScript not.exist怎么用?TypeScript not.exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在should.not的用法示例。


在下文中一共展示了not.exist方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it("AddressSpace#deleteNode - should remove an object and its children from the address space", () => {

        const options = {
            browseName: "SomeObject",
            organizedBy: "ObjectsFolder",
        };
        const object = namespace.addObject(options);
        const innerVar = namespace.addVariable({componentOf: object, browseName: "Hello", dataType: "String"});

        // objects shall  be found with a global nodeId search
        addressSpace.findNode(object.nodeId)!.should.eql(object);
        addressSpace.findNode(innerVar.nodeId)!.should.eql(innerVar);

        let references = object.findReferences("HasComponent", true);
        findReference(references, innerVar.nodeId).length.should.eql(1);

        const rootFolder = addressSpace.rootFolder;
        references = rootFolder.objects.findReferences("Organizes", true);
        findReference(references, object.nodeId).length.should.eql(1);

        // ---------------------------------------------------------
        addressSpace.deleteNode(object.nodeId);
        // ---------------------------------------------------------

        // object shall not be found with a global nodeId search
        should.not.exist(addressSpace.findNode(object.nodeId));
        should.not.exist(addressSpace.findNode(innerVar.nodeId));

        references = rootFolder.findReferences("Organizes", true);
        findReference(references, object.nodeId).length.should.eql(0);

    });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:32,代码来源:test_address_space.ts

示例2: it

    it("should be possible to remove a reference ", () => {

        const boiler = boilerType.instantiate({
            browseName: "Boiler#1",
            nodeId: "ns=1;s=MyBoiler"
        });

        boiler.nodeId.toString().should.eql("ns=1;s=MyBoiler");

        const componentsBefore = boiler.getComponents().map((x: BaseNode) => x.browseName.toString());

        // xx console.log(componentsBefore.join(" "));

        componentsBefore.indexOf("1:PipeX001").should.be.aboveOrEqual(0);

        boiler.removeReference({ referenceType: "HasComponent", nodeId: boiler.pipeX001.nodeId });
        const componentsAfter = boiler.getComponents().map((x: BaseNode) => x.browseName.toString());
        // xx console.log(componentsAfter.join(" "));

        componentsAfter.indexOf("1:PipeX001").should.eql(-1);

        should.not.exist(boiler.pipeX001);

        boiler.removeReference({ referenceType: "HasComponent", nodeId: boiler.pipeX002.nodeId });
        should.not.exist(boiler.pipeX002);

    });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:27,代码来源:test_issue_435_removeReference.ts

示例3: done

 .end(function (err, res) {
     should.not.exist(err);
     should.not.exist(res.header['x-ms-doc-id']);
     res.body.Documents[0].id.should.equal('test-query');
     res.body['isquery'].should.equal(true);
     res.body['content-type'].should.equal('application/query+json');
     done();
 });
开发者ID:jeffhollan,项目名称:docdb-connector,代码行数:8,代码来源:document_test.ts

示例4: it

        it("should instantiate an AlarmConditionType", () => {

            const alarmConditionType = addressSpace.findEventType("AlarmConditionType")!;
            const alarm = alarmConditionType.instantiate({
                browseName: "AlarmCondition1",
                componentOf: source,
                conditionSource: source
            });
            alarm.browseName.toString().should.eql("1:AlarmCondition1");

            should.not.exist((alarm as any).maxTimedShelved);
            should.not.exist((alarm as any).confirmedState);
        });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:13,代码来源:utest_alarm_condition.ts

示例5: it

		it('should remove a key value', async () => {

			await client.del('test1');
			const val = await client.get('test1');
			should.not.exist(val);

		});
开发者ID:AdExchangeGrp,项目名称:aeg-redis,代码行数:7,代码来源:index.integration.test.ts

示例6: it

        it("HRRM-6 should return some data if endTime & numValuesPerNode, are specified (no startTime)", async () => {

            const indexRange = null;
            const dataEncoding = null;
            const historyReadDetails = new ReadRawModifiedDetails({
                endTime: date_add(today, { seconds: +1000000 }),
                isReadModified: false,
                numValuesPerNode: 10000, /// Max
                returnBounds: false,
                startTime: undefined
            });

            const historyReadResult1 = await node.historyRead(
              context, historyReadDetails, indexRange, dataEncoding);

            const dataValues = (historyReadResult1.historyData as HistoryData).dataValues!;
            dataValues.length.should.eql(7);
            should.not.exist(historyReadResult1.continuationPoint, "expecting no continuation points in our case");

            dataValues[6].sourceTimestamp!.should.eql(date_add(today, { seconds: 0 }));
            dataValues[5].sourceTimestamp!.should.eql(date_add(today, { seconds: 1 * 60 }));
            dataValues[4].sourceTimestamp!.should.eql(date_add(today, { seconds: 2 * 60 }));
            dataValues[3].sourceTimestamp!.should.eql(date_add(today, { seconds: 3 * 60 }));
            dataValues[2].sourceTimestamp!.should.eql(date_add(today, { seconds: 4 * 60 }));
            dataValues[1].sourceTimestamp!.should.eql(date_add(today, { seconds: 5 * 60 }));
            dataValues[0].sourceTimestamp!.should.eql(date_add(today, { seconds: 6 * 60 }));

        });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:28,代码来源:test_address_space_historical_data_node.ts

示例7:

 [generatedAddress, generatedTestAddress].forEach((currentAddress) => {
   currentAddress.chain.should.equal(1);
   currentAddress.index.should.equal(113);
   currentAddress.coinSpecific.outputScript.should.equal('a91443457880e5e29555d6ad16bc82ef53891d6512b087');
   currentAddress.coinSpecific.redeemScript.should.equal('522103dc94182103c93690c2bca3fe013c19c956b940645b11b0a752e0e56b156bf4e22103b5f4aa0348bf339400ed7e16c6e960a4a46a1ea4c4cbe21abf6d0403161dc4f22103706ff6b11a8d9e3d63a455788d5d96738929ca642f1f3d8f9acedb689e759f3753ae');
   should.not.exist(currentAddress.coinSpecific.witnessScript);
 });
开发者ID:BitGo,项目名称:BitGoJS,代码行数:7,代码来源:btc.ts

示例8: it

 it('should return the version of the package and nodejs', async function version() {
   validate = function (msg: any, eventName: string): void {
     eventName.should.equal('versionResponse');
     should.exist(msg.services);
     msg.services.should.containEql('commandinterface');
     should.exist(msg.payload);
     const payload = decodeMsg(msg.payload);
     should.exist(payload.version);
     payload.version.should.equal(process.env.npm_package_version);
     should.exist(payload.nodejs);
     payload.nodejs.should.equal(process.version);
   };
   const offset = await commandTopic.$offset(-1);
   const resp = await service.command({
     name: 'version',
   });
   await commandTopic.$wait(offset);
   should.not.exist(resp.error);
   should.exist(resp.data);
   const data = decodeMsg(resp.data);
   should.exist(data.version);
   data.version.should.equal(process.env.npm_package_version);
   should.exist(data.nodejs);
   data.nodejs.should.equal(process.version);
 });
开发者ID:restorecommerce,项目名称:chassis-srv,代码行数:25,代码来源:command_test.ts

示例9:

 [generatedAddress, generatedTestAddress].forEach((currentAddress) => {
   currentAddress.chain.should.equal(21);
   currentAddress.index.should.equal(113);
   currentAddress.coinSpecific.outputScript.should.equal('0020079225c736a65198b0aa75de0d385890e250820ef8731d6f8a3a744e27a3b45d');
   should.not.exist(currentAddress.coinSpecific.redeemScript);
   currentAddress.coinSpecific.witnessScript.should.equal('5221027ec22f583acba5af0a6c5ed43cffb204811cb62cc7cad0e37673ce2ae7693b492103b5324d802f60116366261abb759758629d3d7bd7f2a2d8ff0ee78bfb9e2b387121039e17f3ca6f256ae24cfa9664cf08add84a3cc39ae96c56cacf6b0f846a6d07d853ae');
 });
开发者ID:BitGo,项目名称:BitGoJS,代码行数:7,代码来源:ltc.ts

示例10: it

    it("should browse a variable", async () => {
        const client = OPCUAClient.create({});
        await client.connect(endpointUrl);

        const session = await client.createSession();

        // we want a maximum of 10 refence per nodes
        session.requestedMaxReferencesPerNode = 10;
        const nodeToBrowse: BrowseDescriptionLike = {
            browseDirection: BrowseDirection.Forward,
            nodeClassMask: NodeClassMask.Object,
            nodeId: groupNodeId
        };

        const result: BrowseResult = await session.browse(nodeToBrowse);
        result.references!.length.should.eql(10);

        should.exist(result.continuationPoint);

        const resultNext1: BrowseResult = await session.browseNext(result.continuationPoint, false);

        resultNext1.references!.length.should.eql(10);

        should.exist(resultNext1.continuationPoint);

        const resultNext2: BrowseResult = await session.browseNext(resultNext1.continuationPoint, false);
        resultNext2.references!.length.should.eql(7);
        should.not.exist(resultNext2.continuationPoint);

        await session.close();

        await client.disconnect();
    });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:33,代码来源:test_e2e_#519_Nodecrawler_is_not_browsing_some_nodes.ts

示例11: function

 validate = function (msg: any, eventName: string): void {
   eventName.should.equal('resetResponse');
   should.exist(msg.services);
   msg.services.should.containEql('commandinterface');
   should.exist(msg.payload);
   const payload = decodeMsg(msg.payload);
   should.not.exist(payload.error);
 };
开发者ID:restorecommerce,项目名称:chassis-srv,代码行数:8,代码来源:command_test.ts

示例12: checkUnimplemented

 async function checkUnimplemented() {
   const endpointThrow = client.makeEndpoint('notImplemented', instance);
   should.exist(endpoint);
   const result = await endpointThrow(request);
   should.not.exist(result.data);
   should.exist(result.error);
   should.equal(result.error.message, 'unimplemented');
 });
开发者ID:restorecommerce,项目名称:chassis-srv,代码行数:8,代码来源:transport_test.ts

示例13: it

        it("should instantiate AcknowledgeableConditionType **Without** ConfirmedState", async () => {

            const namespace = addressSpace.getOwnNamespace();
            const condition = namespace.instantiateCondition("AcknowledgeableConditionType", {
                browseName: "AcknowledgeableConditionTypeWithoutConfirmedState",
                componentOf: source,
                conditionSource: source,
                optionals: [
                    // to prevent ConfirmedState and Confirm method to appear
                    // just do not put them in the optionals
                ]
            }, {
                "enabledState.id": { dataType: DataType.Boolean, value: true }
            });

            should.not.exist((condition as any).confirmedState);
            should.not.exist((condition as any).confirm);
        });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:18,代码来源:utest_acknowledgeable_condition.ts

示例14: checkMakeEndpoint

 async function checkMakeEndpoint() {
   const errMessage = 'conn has no method this_method_does_not_exist';
   try {
     endpoint = await client.makeEndpoint(methodNameFail, instance);
   } catch (err) {
     should.exist(err);
     err.message.should.equal(errMessage);
   }
   should.not.exist(endpoint);
 });
开发者ID:restorecommerce,项目名称:chassis-srv,代码行数:10,代码来源:transport_test.ts

示例15: function

        db.insertOne('transactions', order, function (error, outOrder) {
            // verify no error
            should.not.exist(error);

            // verify the order exists
            should.exist(outOrder._id);

            insertOrder = outOrder;
            done();
        });
开发者ID:acrobat888,项目名称:NodeJS,代码行数:10,代码来源:db_test.ts


注:本文中的should.not.exist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。