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


TypeScript assert.doesNotThrow方法代码示例

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


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

示例1: XmlDtd

           + " default newline", () => {
            assert.throws(
                () => new XmlDtd(undefined, true, {
                    name: "abc",
                    sysId: "abc" + String.fromCharCode(0x0001) + "def"
                }));
            assert.doesNotThrow(
                () => new XmlDtd(undefined, false, {
                    name: "abc",
                    sysId: "abc" + String.fromCharCode(0x0001) + "def"
                }));

            assert.throws(
                () => new XmlDtd(undefined, true, {
                    name: "abc",
                    sysId: "'\""
                }));
            assert.doesNotThrow(
                () => new XmlDtd(undefined, false, {
                    name: "abc",
                    sysId: "'\""
                }));

            assert.throws(
                () => new XmlDtd(undefined, true, {
                    name: "abc",
                    sysId: "abc'abc\"abc"
                }));
            assert.doesNotThrow(
                () => new XmlDtd(undefined, false, {
                    name: "abc",
                    sysId: "abc'abc\"abc"
                }));
        });
开发者ID:michaelkourlas,项目名称:node-xmlcreate,代码行数:34,代码来源:XmlDtd.ts

示例2: XmlAttributeText

    + " chars", () => {
     assert.doesNotThrow(
         () => {
             assert.strictEqual(
                 new XmlAttributeText(
                     undefined, true, {
                         charData: "abc" + String.fromCharCode(0x0001)
                                   + "def",
                         replaceInvalidCharsInCharData: true
                     }
                 ).toString(),
                 "abc\uFFFDdef");
         }
     );
     assert.doesNotThrow(
         () => {
             assert.strictEqual(
                 new XmlAttributeText(
                     undefined, false, {
                         charData: "abc" + String.fromCharCode(0x0001)
                                   + "def",
                         replaceInvalidCharsInCharData: true
                     }
                 ).toString(),
                 "abc\uFFFDdef");
         }
     );
 });
开发者ID:michaelkourlas,项目名称:node-xmlcreate,代码行数:28,代码来源:XmlAttributeText.ts

示例3: it

 it("can create a pen", () => {
     const pen = test.context.createPen("", { translate: [0, 0], rotate: 0 });
     assert.isFunction(pen.write);
     assert.doesNotThrow(pen.write);
     if (pen.destroy != null) {
         assert.isFunction(pen.destroy);
         assert.doesNotThrow(pen.destroy);
     }
 });
开发者ID:palantir,项目名称:svg-typewriter,代码行数:9,代码来源:contextTests.ts

示例4: it

    it('Should register multiple entities', () => {
      let manager = getManager().registerEntities([ Address, Tracker ]);

      assert.doesNotThrow(() => {
        return manager.getEntity('Address');
      }, 'No entity found for "Address".');

      assert.doesNotThrow(() => {
        return manager.getEntity('Tracker');
      }, 'No entity found for "Tracker".');
    });
开发者ID:RWOverdijk,项目名称:wetland,代码行数:11,代码来源:EntityManager.spec.ts

示例5: XmlDecl

           + " not allowed in attribute; default quotes", () => {
            assert.throws(
                () => new XmlDecl(undefined, true, {
                    version: "1"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlDecl(undefined, false, {
                            version: "1"
                        }).toString(),
                        "<?xml version='1'?>");
                });

            assert.throws(
                () => new XmlDecl(undefined, true, {
                    version: "1."
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlDecl(undefined, false, {
                            version: "1."
                        }).toString(),
                        "<?xml version='1.'?>");
                });

            assert.throws(
                () => new XmlDecl(undefined, true, {
                    version: "1.2a"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlDecl(undefined, false, {
                            version: "1.2a"
                        }).toString(),
                        "<?xml version='1.2a'?>");
                });

            assert.throws(
                () => new XmlDecl(undefined, true, {
                    version: "2.0"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlDecl(undefined, false, {
                            version: "2.0"
                        }).toString(),
                        "<?xml version='2.0'?>");
                });
        });
开发者ID:michaelkourlas,项目名称:node-xmlcreate,代码行数:53,代码来源:XmlDecl.ts

示例6: XmlCdata

           + " chars", () => {
            assert.throws(
                () => new XmlCdata(undefined, true, {
                    charData: "]]>"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlCdata(undefined, false, {
                            charData: "]]>"
                        }).toString(),
                        "<![CDATA[]]>]]>");
                });

            assert.throws(
                () => new XmlCdata(undefined, true, {
                    charData: "abc]]>123"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlCdata(undefined, false, {
                            charData: "abc]]>123"
                        }).toString(),
                        "<![CDATA[abc]]>123]]>");
                });

            assert.throws(
                () => new XmlCdata(undefined, true, {
                    charData: "]]>abc123"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlCdata(undefined, false, {
                            charData: "]]>abc123"
                        }).toString(),
                        "<![CDATA[]]>abc123]]>");
                });

            assert.throws(
                () => new XmlCdata(undefined, true, {
                    charData: "abc123]]>"
                }));
            assert.doesNotThrow(
                () => {
                    assert.strictEqual(
                        new XmlCdata(undefined, false, {
                            charData: "abc123]]>"
                        }).toString(),
                        "<![CDATA[abc123]]>]]>");
                });
        });
开发者ID:michaelkourlas,项目名称:node-xmlcreate,代码行数:53,代码来源:XmlCdata.ts

示例7: it

    it("should return an instance of JsonSchemaGenerator", () => {
        const program = TJS.getProgramFromFiles([resolve(BASE + "comments/main.ts")]);
        const generator = TJS.buildGenerator(program);

        assert.instanceOf(generator, TJS.JsonSchemaGenerator);
        if (generator !== null) {
            assert.doesNotThrow(() => generator.getSchemaForSymbol("MyObject"));
            assert.doesNotThrow(() => generator.getSchemaForSymbol("Vector3D"));

            const symbols = generator.getUserSymbols();
            assert(symbols.indexOf("MyObject") > -1);
            assert(symbols.indexOf("Vector3D") > -1);
        }
    });
开发者ID:otgerrogla,项目名称:typescript-json-schema,代码行数:14,代码来源:schema.test.ts

示例8: it

 it("put doesn't throw", () => {
   assert.doesNotThrow(() => {
     child.put(new Blob(['a']));
     child.put(new Uint8Array(10));
     child.put(new ArrayBuffer(10));
   });
 });
开发者ID:RameshBhupathi,项目名称:firebase-js-sdk,代码行数:7,代码来源:reference_test.ts

示例9: it

 it("resolves custom rule directories as relative paths", () => {
     let rule: RuleConstructor | undefined;
     assert.doesNotThrow(() => {
         rule = findRule("always-fail", "test/files/custom-rules");
     });
     assert.isDefined(rule);
 });
开发者ID:JoshuaKGoldberg,项目名称:tslint,代码行数:7,代码来源:ruleLoaderTests.ts

示例10: XmlDocument

           + " default indentation; default newline", () => {
            assert.throws(() => {
                const node = new XmlDocument({});
                node.decl({});
                node.dtd({name: "abc"});
                node.comment({charData: "def"});
                node.procInst({target: "ghi"});
                node.comment({charData: "jkl"});
                node.procInst({target: "mno"});
                node.toString();
            });

            assert.doesNotThrow(() => {
                const node = new XmlDocument({validation: false});
                node.decl({});
                node.dtd({name: "abc"});
                node.comment({charData: "def"});
                node.procInst({target: "ghi"});
                node.comment({charData: "jkl"});
                node.procInst({target: "mno"});
                assert.strictEqual(
                    node.toString(),
                    "<?xml version='1.0'?>\n<!DOCTYPE abc>\n"
                    + "<!--def-->\n<?ghi?>\n<!--jkl-->\n<?mno?>");
            });
        });
开发者ID:michaelkourlas,项目名称:node-xmlcreate,代码行数:26,代码来源:XmlDocument.ts


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