• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript jasmine.execute函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中jasmine.execute函数的典型用法代码示例。如果您正苦于以下问题:TypeScript execute函数的具体用法?TypeScript execute怎么用?TypeScript execute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: Promise

  return new Promise(resolve => {
    runner.onComplete((passed: boolean) => resolve(passed ? 0 : 1));
    if (args.seed != undefined) {
      runner.seed(args.seed);
    }

    runner.execute(tests, args.filter);
  });
开发者ID:angular,项目名称:angular-cli,代码行数:8,代码来源:test.ts


示例2: function

export default function (args: ParsedArgs, logger: logging.Logger) {
  const specGlob = args.large ? '*_spec_large.ts' : '*_spec.ts';
  const regex = args.glob ? args.glob : `packages/**/${specGlob}`;

  if (args['code-coverage']) {
    runner.env.addReporter(new IstanbulReporter());
  }

  // Run the tests.
  const allTests =
    glob.sync(regex)
      .map(p => relative(projectBaseDir, p));

  const tsConfigPath = join(__dirname, '../tsconfig.json');
  const tsConfig = ts.readConfigFile(tsConfigPath, ts.sys.readFile);
  const pattern = '^('
                  + (tsConfig.config.exclude as string[])
                    .map(ex => '('
                      + ex.split(/[\/\\]/g).map(f => f
                          .replace(/[\-\[\]{}()+?.^$|]/g, '\\$&')
                          .replace(/^\*\*/g, '(.+?)?')
                          .replace(/\*/g, '[^/\\\\]*'))
                        .join('[\/\\\\]')
                      + ')')
                    .join('|')
                  + ')($|/|\\\\)';
  const excludeRe = new RegExp(pattern);
  let tests = allTests.filter(x => !excludeRe.test(x));

  if (!args.full) {
    // Remove the tests from packages that haven't changed.
    tests = tests
      .filter(p => Object.keys(packages).some(name => {
        const relativeRoot = relative(projectBaseDir, packages[name].root);

        return p.startsWith(relativeRoot) && packages[name].dirty;
      }));

    logger.info(`Found ${tests.length} spec files, out of ${allTests.length}.`);
  }

  runner.execute(tests);
}
开发者ID:iwe7,项目名称:devkit,代码行数:43,代码来源:test.ts


示例3: require

export const runTests = (specFiles: string[], helpers?: string[]) => {
  // We can't use `import` here, because of the following mess:
  // - GitHub project `jasmine/jasmine` is `jasmine-core` on npm and its typings `@types/jasmine`.
  // - GitHub project `jasmine/jasmine-npm` is `jasmine` on npm and has no typings.
  //
  // Using `import...from 'jasmine'` here, would import from `@types/jasmine` (which refers to the
  // `jasmine-core` module and the `jasmine` module).
  // tslint:disable-next-line: no-var-requires variable-name
  const Jasmine = require('jasmine');
  const config = {
    helpers,
    random: true,
    spec_files: specFiles,
    stopSpecOnExpectationFailure: true,
  };

  process.on('unhandledRejection', (reason: any) => console.log('Unhandled rejection:', reason));

  const runner = new Jasmine();
  runner.loadConfig(config);
  runner.onComplete((passed: boolean) => process.exit(passed ? 0 : 1));
  runner.execute();
};
开发者ID:AnthonyPAlicea,项目名称:angular,代码行数:23,代码来源:run-tests.ts


示例4: expect

        myFighter.idFight = "1";
        myFighter.season = 0;
        myFighter.assignedTeam = Team.Blue;
        myFighter.isReady = true;

        await ActiveFighterRepository.persist(myFighter);

        expect(myFighter.createdAt).toBeDefined();
        done();
    });

    it("should load all Active Fighter from fight #1", async function (done) {
        let myFighter = new ActiveFighter();
        myFighter.initialize();
        myFighter.name = "Aelith Blanchette";
        myFighter.idFight = "1";
        myFighter.season = 0;
        myFighter.assignedTeam = Team.Blue;
        myFighter.isReady = true;

        await ActiveFighterRepository.persist(myFighter);

        let actors = await ActiveFighterRepository.loadFromFight("1");
        expect(actors.length).toBeGreaterThan(0);
        done();
    });

});

testSuite.execute();
开发者ID:AelithBlanchett,项目名称:nsfwbot,代码行数:30,代码来源:ActiveFighterRepositoryTest.ts


示例5: require

#!/usr/bin/env node
/**
 * @license
 * Copyright 2018 Google LLC. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =============================================================================
 */
// tslint:disable-next-line:no-require-imports
const jasmineCtor = require('jasmine');
const runner = new jasmineCtor();

runner.loadConfig({spec_files: ['scripts/release_notes/**/*_test.ts']});
runner.execute();
开发者ID:Guolighting,项目名称:tfjs,代码行数:23,代码来源:run_tests.ts


示例6: Promise

 return new Promise(resolve => {
   runner.onComplete((passed: boolean) => resolve(passed ? 0 : 1));
   runner.execute(tests);
 });
开发者ID:DevIntent,项目名称:angular-cli,代码行数:4,代码来源:test.ts


示例7: join

import * as glob from 'glob';
import 'jasmine';
import { join, relative } from 'path';

const projectBaseDir = join(__dirname, '../..');
require('source-map-support').install({
  hookRequire: true,
});

const Jasmine = require('jasmine');
const runner = new Jasmine({ projectBaseDir: projectBaseDir });

const files = `packages/schematics/**/*_spec.ts`;
// const files = `packages/schematics/plugin/*_spec.ts`;

const tests = glob.sync(files).map(p => relative(projectBaseDir, p));

runner.execute(tests);
开发者ID:wexz,项目名称:delon,代码行数:18,代码来源:test.ts


示例8: mockDom

mockDom( [], function () {
    iJasmine.execute();
});
开发者ID:Izhaki,项目名称:gefri,代码行数:3,代码来源:jasmine.ts


示例9: Jasmine

var jasmineInst                            = new Jasmine();
global['jasmine'].DEFAULT_TIMEOUT_INTERVAL = 5000;

console.log('Setting up new default JASMINE Suite :)');
console.log('----------------------------------------------------');


// Disable default reporter
jasmineInst.configureDefaultReporter({
    print: function () {
    }
});

// Add a basic reporter for the console :)
jasmineInst.addReporter(new SpecReporter({
    displayStacktrace    : 'all',
    displayPendingSummary: false,
    displayPendingSpec   : false
}));

// Add our custom HTML reporter
jasmineInst.addReporter(new BeachDayReporter({
    logToConsole         : true,
    includeAllConsoleLogs: false,
    maxTestTime          : 2000
}));

jasmineInst.loadConfigFile('jasmine_config.json');
jasmineInst.execute();
开发者ID:PepkorIT,项目名称:beach-day,代码行数:29,代码来源:boot.ts


示例10: require

'use strict';

var Jasmine = require('jasmine');
var j = new Jasmine();

j.loadConfigFile('spec/support/jasmine.json');
j.configureDefaultReporter({
    showColors: true
});
j.execute();
开发者ID:jvitor83,项目名称:typings-packagejson,代码行数:10,代码来源:runner.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript jasmine.expect函数代码示例发布时间:2022-05-25
下一篇:
TypeScript jasmine.configureDefaultReporter函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap