update tests
This commit is contained in:
parent
130c4177a6
commit
55ddbece13
3
test/test.d.ts
vendored
3
test/test.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
declare var taskbuffer: any;
|
||||
declare var classes: any;
|
||||
declare var should: any;
|
10
test/test.js
10
test/test.js
@ -1,15 +1,15 @@
|
||||
"use strict";
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index");
|
||||
var classes = require("../dist/taskbuffer.classes");
|
||||
var should = require("should");
|
||||
describe("taskbuffer", function () {
|
||||
describe(".task()", function () {
|
||||
var testTask;
|
||||
it("should return a new task to var testTask", function () {
|
||||
testTask = taskbuffer.task();
|
||||
testTask = new taskbuffer.Task({ taskFunction: function () { } });
|
||||
});
|
||||
it("testTask should be instance of Task", function () {
|
||||
testTask.should.be.instanceof(classes.Task);
|
||||
it("testTask should be and instance of Task", function () {
|
||||
testTask.should.be.instanceof(taskbuffer.Task);
|
||||
});
|
||||
it("testTask.idle is true", function () {
|
||||
if (!testTask.idle) {
|
||||
@ -23,4 +23,4 @@ describe("taskbuffer", function () {
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQUFHLE9BQU8sQ0FBQyxlQUFlLENBQUMsQ0FBQztBQUMxQyxJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsNEJBQTRCLENBQUMsQ0FBQztBQUNwRCxJQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7QUFDL0IsUUFBUSxDQUFDLFlBQVksRUFBQztJQUNsQixRQUFRLENBQUMsU0FBUyxFQUFDO1FBQ2YsSUFBSSxRQUFRLENBQUM7UUFDYixFQUFFLENBQUMsMENBQTBDLEVBQUM7WUFDMUMsUUFBUSxH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WZmZXJcIixmdW5jdGlvbigpe1xuICAgIGRlc2NyaWJlKFwiLnRhc2soKVwiLGZ1bmN0aW9uKCl7XG4gICAgICAgIHZhciB0ZXN0VGFzaztcbiAgICAgICAgaXQoXCJzaG91bGQgcmV0dXJuIGEgbmV3IHRhc2sgdG8gdmFyIHRlc3RUYXNrXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHRlc3RUYXNrID0gdGFza2J1ZmZlci50YXNrKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwidGVzdFRhc2sgc2hvdWxkIGJlIGluc3RhbmNlIG9mIFRhc2tcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgdGVzdFRhc2suc2hvdWxkLmJlLmluc3RhbmNlb2YoY2xhc3Nlcy5UYXNrKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGl0KFwidGVzdFRhc2suaWRsZSBpcyB0cnVlXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIGlmICghdGVzdFRhc2suaWRsZSl7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidGVzdFRhc2suaWRsZSBpcyBub3QgdHJ1ZVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGl0KFwidGVzdFRhc2sucnVubmluZyBpcyB0eXBlIGJvb2xlYW4gYW5kIGluaXRpYWxseSBmYWxzZVwiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICB0ZXN0VGFzay5ydW5uaW5nLnNob3VsZC5iZS50eXBlKFwiYm9vbGVhblwiKTtcbiAgICAgICAgICAgIHRlc3RUYXNrLnJ1bm5pbmcuc2hvdWxkLmJlLmZhbHNlKCk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xufSk7Il19
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFB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igpe1xuICAgICAgICAgICAgdGVzdFRhc2sucnVubmluZy5zaG91bGQuYmUudHlwZShcImJvb2xlYW5cIik7XG4gICAgICAgICAgICB0ZXN0VGFzay5ydW5uaW5nLnNob3VsZC5iZS5mYWxzZSgpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbn0pOyJdfQ==
|
||||
|
11
test/test.ts
11
test/test.ts
@ -1,16 +1,15 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index");
|
||||
var classes = require("../dist/taskbuffer.classes");
|
||||
var should = require("should");
|
||||
import taskbuffer = require("../dist/index");
|
||||
let should = require("should");
|
||||
describe("taskbuffer",function(){
|
||||
describe(".task()",function(){
|
||||
var testTask;
|
||||
it("should return a new task to var testTask",function(){
|
||||
testTask = taskbuffer.task();
|
||||
testTask = new taskbuffer.Task({taskFunction:function(){}});
|
||||
});
|
||||
|
||||
it("testTask should be instance of Task",function(){
|
||||
testTask.should.be.instanceof(classes.Task);
|
||||
it("testTask should be and instance of Task",function(){
|
||||
testTask.should.be.instanceof(taskbuffer.Task);
|
||||
});
|
||||
it("testTask.idle is true",function(){
|
||||
if (!testTask.idle){
|
||||
|
Loading…
Reference in New Issue
Block a user