##// END OF EJS Templates
Merge with di-typescript
Merge with di-typescript

File last commit:

r51:43a2828f8abe v1.2.0-rc di-typescript
r57:c981b10db77f merge default
Show More
trace-test.js
29 lines | 1.0 KiB | application/javascript | JavascriptLexer
cin
tests moved under src/ folder...
r50 define(["tape"], function(tape) {
"use strict";
var sourceId = '73a633f3-eab8-49b0-8601-07cae710f234';
var sourceId2 = '3ba9c7cd-ed77-437b-9a2f-1cbeb1226b5b';
tape('Load TraceSource for the module', function(t) {
cin
working version...
r51 require(["@implab/core/log/trace!" + sourceId, "@implab/core/log/TraceSource"], function(trace, TraceSource_1) {
cin
tests moved under src/ folder...
r50 var TraceSource = TraceSource_1.TraceSource;
t.equal(trace && trace.id, sourceId, "trace should be taken from the loader plugin parameter");
var count = 0;
var h = TraceSource.on(function(x) {
if(x.id == sourceId || x.id == sourceId2)
count++;
});
t.equal(count, 1, "should see created channel immediatelly");
t.equal(trace, TraceSource.get(sourceId), "should get same TraceSource from registry");
t.equal(count, 1);
TraceSource.get(sourceId2);
t.equal(count, 2);
h.destroy();
t.end();
});
});
});