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

TypeScript vows.describe函数代码示例

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

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



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

示例1: require

const assert = require('assert');
var vows = require('vows');


var _name:string = "test-"+new Date().getTime();
var testConfig = {
    test: new Date(),
    result: 'ok'
};
var configurationsAPI = require('../../pmodules/configurations/configurationsAPI');


var tests = vows.describe('configurationsAPI');
tests.addBatch({
    'configurationsAPI-save': {
        topic: {},
        'save a new configuration': {
            topic: function(topic) {
                configurationsAPI.saveConfigruation(_name, testConfig, (err) => {
                    topic.err = err;
                    this.callback(null, topic);
                });
                return;
            },
            'has been saved': function(topic) {
                assert.equal(topic.err, null);
            }
        }
    }
});
tests.addBatch({
开发者ID:portalTS,项目名称:portalTS,代码行数:31,代码来源:configurations.ts


示例2: require

/// <reference path='../../../../interfaces/node/node.d.ts'/>
/// <reference path='../../../../interfaces/locomotive/locomotive.d.ts'/>
/// <reference path='../../../../interfaces/should/should.d.ts'/>
/// <reference path='../../../../interfaces/async/async.d.ts'/>

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("LabelsController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"Index without user and repository": {
			topic: testApi.httpGetTopic("/labels"),

			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without user": {
			topic: testApi.httpGetTopic("/labels?repository=repo"),

			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without repository": {
			topic: testApi.httpGetTopic("/labels?user=test"),

			"returns error": testApi.verifyNoRepositoryProvidedError()
开发者ID:ciuliot,项目名称:github-tracker,代码行数:31,代码来源:05_labelsControllerTest.ts


示例3: require

/// <reference path='../../../../interfaces/node/node.d.ts'/>
/// <reference path='../../../../interfaces/locomotive/locomotive.d.ts'/>
/// <reference path='../../../../interfaces/should/should.d.ts'/>
/// <reference path='../../../../interfaces/async/async.d.ts'/>

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("IssuesController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"Index": {
			"without user, repository and milestone": {
				topic: testApi.httpGetTopic("/issues"),
				"returns error": testApi.verifyNoUserProvidedError()
			},
			"without user and milestone": {
				topic: testApi.httpGetTopic("/issues?repository=repo"),
				"returns error": testApi.verifyNoUserProvidedError()
			},
			"without repository and milestone": {
				topic: testApi.httpGetTopic("/issues?user=test"),
				"returns error": testApi.verifyNoRepositoryProvidedError()
			},
			"without repository": {
开发者ID:ciuliot,项目名称:github-tracker,代码行数:31,代码来源:06_issuesControllerTest.ts


示例4: require

/// <reference path='../../../../interfaces/node/node.d.ts'/>
/// <reference path='../../../../interfaces/locomotive/locomotive.d.ts'/>
/// <reference path='../../../../interfaces/should/should.d.ts'/>
/// <reference path='../../../../interfaces/async/async.d.ts'/>

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("ImpedimentsController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"Index without user and repository": {
			topic: testApi.httpGetTopic("/impediments/"),
			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without user": {
			topic: testApi.httpGetTopic("/impediments/?repository=repo"),
			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without repository": {
			topic: testApi.httpGetTopic("/impediments/?user=test"),

			"returns error": testApi.verifyNoRepositoryProvidedError()
		},
		// ToDo
开发者ID:ciuliot,项目名称:github-tracker,代码行数:31,代码来源:08_impedimentsControllerTest.ts


示例5: require

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

function testCurrentUserMarker(result: any[]) {
	result[0].should.eql({ id: null, login: null, avatar_url: null });

}

vows.describe("CollaboratorsController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"Index without user and repository": {
			topic: testApi.httpGetTopic("/collaborators"),

			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without user": {
			topic: testApi.httpGetTopic("/collaborators?repository=repo"),

			"returns error": testApi.verifyNoUserProvidedError()
		},
		"Index without repository": {
			topic: testApi.httpGetTopic("/collaborators?user=test"),
开发者ID:ciuliot,项目名称:github-tracker,代码行数:29,代码来源:03_collaboratorsControllerTest.ts


示例6: require

/// <reference path='../../../../interfaces/node/node.d.ts'/>
/// <reference path='../../../../interfaces/locomotive/locomotive.d.ts'/>
/// <reference path='../../../../interfaces/should/should.d.ts'/>
/// <reference path='../../../../interfaces/async/async.d.ts'/>

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("UserController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"User get data": {
			topic: testApi.httpGetTopic("/user"),
		
			"is returned correctly": function (err: any, response: http.ClientResponse, textBody: string) {
				var result = testApi.verifyJsonResponse(err, response, textBody);

				result.name.should.be.exactly("Tester Unit");
				result.login.should.be.exactly("utester");
				result.avatar_url.should.be.exactly("http://void.com/image.gif");
			}

		}
	}
}).export(module);
开发者ID:ciuliot,项目名称:github-tracker,代码行数:31,代码来源:02_userControllerTest.ts


示例7: require

/// <reference path='../../../../interfaces/node/node.d.ts'/>
/// <reference path='../../../../interfaces/locomotive/locomotive.d.ts'/>
/// <reference path='../../../../interfaces/should/should.d.ts'/>
/// <reference path='../../../../interfaces/async/async.d.ts'/>

import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("AuthenticationController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"starts": (err: any) => {
			should.not.exist(err);
		},
		"Verify GET authentication": {
			topic: function() {
				var self = this;
				var getEndpoints = ["/", "/developer_board/test/test/1", "/qa_board/test/test/1" ,"/user", "/labels", "/milestones", "/collaborators", "/issues"];

				async.forEachSeries(getEndpoints, (endpoint, callback) => {
					testApi.httpGet(endpoint, (err: any, response: http.ClientResponse) => {
						should.not.exist(err);
	    				should.exist(response);
	    				response.should.have.status(401);
				
开发者ID:ciuliot,项目名称:github-tracker,代码行数:30,代码来源:01_authenticationControllerTest.ts


示例8: require

var assert = require('assert'),
  vows = require('vows'),
  Fuse = require('fuse')

var verbose = false

vows.describe('Flat list of strings: ["Apple", "Orange", "Banana"]').addBatch({
  'Flat:': {
    topic: function () {
      var fruits = ['Apple', 'Orange', 'Banana']
      var fuse = new Fuse(fruits, {
        verbose: verbose
      })
      return fuse
    },
    'When searching for the term "Apple"': {
      topic: function (fuse) {
        var result = fuse.search('Apple')
        return result
      },
      'we get a list of containing 1 item, which is an exact match': function (result) {
        assert.equal(result.length, 1)
      },
      'whose value is the index 0, representing ["Apple"]': function (result) {
        assert.equal(result[0], 0)
      },
    },
    'When performing a fuzzy search for the term "ran"': {
      topic: function (fuse) {
        var result = fuse.search('ran')
        return result
开发者ID:MikaAK,项目名称:fuse-typings,代码行数:31,代码来源:fuse-test.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript browser.getPixelRatio函数代码示例发布时间:2022-05-25
下一篇:
TypeScript vm.Script类代码示例发布时间: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