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


TypeScript assert.match方法代码示例

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


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

示例1: it

    it('should replace object expression node `key` property with literal value by unicode value', () => {
        let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
            `var test = { 'foo': 0 };`,
            Object.assign({}, NO_CUSTOM_NODES_PRESET)
        );

        assert.match(obfuscationResult.getObfuscatedCode(),  /^var *test *= *\{'\\x66\\x6f\\x6f':0x0\};$/);
    });
开发者ID:surjit,项目名称:javascript-obfuscator,代码行数:8,代码来源:ObjectExpressionObfuscator.spec.ts

示例2: it

        it('should replace member expression dot notation call by square brackets call with unicode literal value', () => {
            let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                `var test = console.log;`,
                Object.assign({}, NO_CUSTOM_NODES_PRESET)
            );

            assert.match(obfuscationResult.getObfuscatedCode(),  /var *test *= *console\['\\x6c\\x6f\\x67'\];/);
        });
开发者ID:surjit,项目名称:javascript-obfuscator,代码行数:8,代码来源:MemberExpressionObfuscator.spec.ts

示例3: it

    it('should not obfuscate method definition node with `constructor` key', () => {
        let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
            code,
            Object.assign({}, NO_CUSTOM_NODES_PRESET)
        );

        assert.match(obfuscationResult.getObfuscatedCode(),  /constructor\(\)\{\}/);
    });
开发者ID:surjit,项目名称:javascript-obfuscator,代码行数:8,代码来源:MethodDefinitionObfuscator.spec.ts

示例4: it

 it('stack frames', () => {
   try {
     dummy1();
     assert.ok(false);
   } catch (e) {
     assert.match(e.stack, /dummy2[\s\S]*?dummy1/);
   }
 });
开发者ID:AldoHub,项目名称:NodeJS-Firestore-JSON-API,代码行数:8,代码来源:errors.test.ts

示例5: it

 it('should obfuscate simple code with variable inside global scope', () => {
     assert.match(
         JavaScriptObfuscator.obfuscate(
             `var test = 1;`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET)
         ).getObfuscatedCode(),
         /^var *test *= *0x\d+;$/
     );
 });
开发者ID:surjit,项目名称:javascript-obfuscator,代码行数:9,代码来源:JavaScriptObfuscator.spec.ts

示例6: function

 helper.dataDrivenTest(tests, function(data, expect) {
   try {
     parse(data);
   } catch (e) {
     assert.match(e.message, expect);
     return;
   }
   assert.fail(undefined, undefined, "No exception thrown.");
 });
开发者ID:brewsoftware,项目名称:bolt,代码行数:9,代码来源:parser-test.ts

示例7: test

 test('will log to a file when asked to', async() => {
   const {client, baseDir} = await createTestEnvironment();
   const logFile = join(baseDir, 'pes.log');
   await client.changeConfiguration({logToFile: logFile});
   await delay(100);
   assert.match(
       readFileSync(logFile, 'utf-8'),
       /^\n\n\n\n\nInitialized with workspace path:/);
 });
开发者ID:asdfg9822,项目名称:polymer-editor-service,代码行数:9,代码来源:logger_test.ts

示例8: it

        it('should add source map import to obfuscated code if source map mode is `separate`', () => {
            expectedObfuscationResult = getCorrectedObfuscationResult(
                obfuscatedCode,
                sourceMap,
                'output.js.map',
                SourceMapMode.Separate
            );

            assert.match(expectedObfuscationResult.getObfuscatedCode(), /sourceMappingURL=output\.js\.map/);
        });
开发者ID:surjit,项目名称:javascript-obfuscator,代码行数:10,代码来源:SourceMapCorrector.spec.ts


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