##// END OF EJS Templates
Added tag v1.0.0-rc2 for changeset fc9f82c082ef
Added tag v1.0.0-rc2 for changeset fc9f82c082ef

File last commit:

r2:8ec37bf1b4d1 default
r5:e5727b40aba0 default
Show More
TestTraits.ts
62 lines | 2.0 KiB | video/mp2t | TypeScriptLexer
cin
Initial commit, copied files related to .tsx scripts support.
r0 import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces";
import { Cancellation } from "@implab/core-amd/Cancellation";
import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource";
import { argumentNotNull, destroy } from "@implab/core-amd/safe";
cin
typescript strict mode...
r1 import { TapWriter } from "./Tap";
cin
Initial commit, copied files related to .tsx scripts support.
r0
export class TapeWriter implements IDestroyable {
cin
typescript strict mode...
r1
private readonly _t: TapWriter;
cin
Initial commit, copied files related to .tsx scripts support.
r0
private readonly _subscriptions = new Array<IDestroyable>();
cin
created typings for basic part of dojo and dijit further work is required to...
r2 private _destroyed = false;
cin
Initial commit, copied files related to .tsx scripts support.
r0
cin
typescript strict mode...
r1 constructor(t: TapWriter) {
argumentNotNull(t, "test");
cin
created typings for basic part of dojo and dijit further work is required to...
r2 this._t = t;
cin
Initial commit, copied files related to .tsx scripts support.
r0 }
writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) {
if (!this._destroyed) {
const subscription = source.on(this.writeEvent.bind(this));
if (ct.isSupported()) {
ct.register(subscription.destroy.bind(subscription));
}
this._subscriptions.push(subscription);
}
}
writeEvent(next: TraceEvent) {
if (next.level >= DebugLevel) {
cin
typescript strict mode...
r1 this._t.comment(`DEBUG ${next.source.id} ${next}`);
cin
Initial commit, copied files related to .tsx scripts support.
r0 } else if (next.level >= LogLevel) {
cin
typescript strict mode...
r1 this._t.comment(`LOG ${next.source.id} ${next}`);
cin
Initial commit, copied files related to .tsx scripts support.
r0 } else if (next.level >= WarnLevel) {
cin
typescript strict mode...
r1 this._t.comment(`WARN ${next.source.id} ${next}`);
cin
Initial commit, copied files related to .tsx scripts support.
r0 } else {
cin
typescript strict mode...
r1 this._t.comment(`ERROR ${next.source.id} ${next}`);
cin
Initial commit, copied files related to .tsx scripts support.
r0 }
}
destroy() {
cin
created typings for basic part of dojo and dijit further work is required to...
r2 if (this._destroyed)
return;
this._destroyed = true;
cin
Initial commit, copied files related to .tsx scripts support.
r0 this._subscriptions.forEach(destroy);
}
}
cin
created typings for basic part of dojo and dijit further work is required to...
r2 type TestCallback = (ok: (msg: string) => void, fail: (msg: string) => void, trace: TraceSource) => void;
type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void>;
cin
Initial commit, copied files related to .tsx scripts support.
r0
cin
created typings for basic part of dojo and dijit further work is required to...
r2 export function test(name: string, cb: TestCallback ): void;
export function test(name: string, cb: AsyncTestCallback): void;
cin
typescript strict mode...
r1 export function test(name: string, cb: TestCallback | AsyncTestCallback) {
cin
created typings for basic part of dojo and dijit further work is required to...
r2
cin
typescript strict mode...
r1 }
cin
Initial commit, copied files related to .tsx scripts support.
r0
cin
typescript strict mode...
r1 export function run() {
cin
Initial commit, copied files related to .tsx scripts support.
r0
}