Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
cin
- Mon, 03 Sep 2018 20:24:44
Show More
0
test/js/trace-test.js
test/js/trace-test.js
created
644
+29
0
@@
-0,0
+1,29
1
define ([ "tape" ], function ( tape ) {
2
"use strict" ;
3
var sourceId = '73a633f3-eab8-49b0-8601-07cae710f234' ;
4
var sourceId2 = '3ba9c7cd-ed77-437b-9a2f-1cbeb1226b5b' ;
5
tape ( 'Load TraceSource for the module' , function ( t ) {
6
require ([ "core/log/trace!" + sourceId , "core/log/TraceSource" ], function ( trace , TraceSource ) {
7
t . equal ( trace && trace . id , sourceId , "trace should be taken from the loader plugin parameter" );
8
9
var count = 0 ;
10
11
var h = TraceSource . on ( function ( x ) {
12
if ( x . id == sourceId || x . id == sourceId2 )
13
count ++ ;
14
});
15
16
t . equal ( count , 1 , "should see created channel immediatelly" );
17
t . equal ( trace , TraceSource . get ( sourceId ), "should get same TraceSource from registry" );
18
t . equal ( count , 1 );
19
20
TraceSource . get ( sourceId2 );
21
22
t . equal ( count , 2 );
23
24
h . destroy ();
25
26
t . end ();
27
});
28
});
29
});
No newline at end of file
0
test/ts/TraceSourceTests.ts
test/ts/TraceSourceTests.ts
created
644
+14
0
@@
-0,0
+1,14
1
import * as TraceSource from '@implab/core/log/TraceSource'
2
import * as tape from 'tape' ;
3
4
const sourceId = 'test/TraceSourceTests' ;
5
6
tape ( '' , t => {
7
let trace = TraceSource . get ( sourceId );
8
9
let h = trace . on (( sender , level , msg ) => {
10
11
});
12
13
h . destroy ();
14
});
No newline at end of file
0
src/ts/components/ActivatableMixin.ts
src/ts/components/ActivatableMixin.ts
+3
-1
@@
-3,10
+3,12
import { IActivatable } from './IActivat
3
import { AsyncComponent } from './AsyncComponent' ;
3
import { AsyncComponent } from './AsyncComponent' ;
4
import { ICancellation } from '../ICancellation' ;
4
import { ICancellation } from '../ICancellation' ;
5
import { EmptyCancellation } from '../EmptyCancellation' ;
5
import { EmptyCancellation } from '../EmptyCancellation' ;
6
import * as log from '@implab/core/log/trace!' ;
6
import * as TraceSource from '../log/TraceSource ' ;
7
7
8
type Constructor < T = {} > = new (... args : any []) => T ;
8
type Constructor < T = {} > = new (... args : any []) => T ;
9
9
10
const log = TraceSource . get ( '@implab/core/components/ActivatableMixin' );
11
10
function ActivatableMixin < TBase extends Constructor < AsyncComponent >> ( Base : TBase ) {
12
function ActivatableMixin < TBase extends Constructor < AsyncComponent >> ( Base : TBase ) {
11
return class extends Base implements IActivatable {
13
return class extends Base implements IActivatable {
12
_controller : IActivationController ;
14
_controller : IActivationController ;
0
src/ts/log/TraceSource.ts
src/ts/log/TraceSource.ts
+1
-1
@@
-152,7
+152,7
class TraceSource {
152
}
152
}
153
153
154
static on ( handler : TraceSourceHandler ) {
154
static on ( handler : TraceSourceHandler ) {
155
Registry . instance . on ( handler );
155
return Registry . instance . on ( handler );
156
}
156
}
157
157
158
static get ( id : any ) {
158
static get ( id : any ) {
0
test/js/plan.js
test/js/plan.js
+1
-1
@@
-1,1
+1,1
1
define ([ "./dummy" , "./example" , "./ActivatableTests"]);
No newline at end of file
1
define ([ "./ActivatableTests " , "./trace-test " ]);
No newline at end of file
0
src/ts/log/trace.ts
src/ts/log/trace.ts
removed
0
-12
1
NO CONTENT: file was removed
NO CONTENT: file was removed
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages