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


TypeScript vows.describe函数代码示例

本文整理汇总了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;未经允许,请勿转载。