/** * Created by liuchang on 16/1/21. * * this test karma configuration and should assertion lib * it should work with typescript and es6 */ 'use strict'; import * as co from 'co'; import "should"; describe('karma test', function () { describe('should test', function () { it('should return -1 when the value is not present', function () { [1, 2, 3].indexOf(5).should.equal(-1); [1, 2, 3].indexOf(0).should.equal(-1); }); it('should support universal font', function () { '中文测试'.should.be.a.String(); '日本語テスト'.should.be.a.String(); }); it('should run in async task', (done)=> { let val = 1; setTimeout(function () { val = 10; val.should.equal(10); done(); }, 500); }) }); describe('co test', function () { it('should be a function', function () { co.should.be.a.Function(); }); it('co should work', function () { let ret = co(function *() { yield Promise.resolve(1); }); ret.should.be.Promise(); }) }); });