當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript jasmine.execute函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。