Skip to content

Commit

Permalink
feat(context): Add autoFlush.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Aug 21, 2017
1 parent fa03d18 commit 5f9ff6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Expect } from "./expect";

export class Context {

public autoFlush = true;
public configure = configure;

constructor(public testScheduler: TestScheduler) {}
Expand Down
4 changes: 3 additions & 1 deletion source/marbles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export function marbles(test: (context: Context, ...args: any[]) => any): (...ar
const testScheduler = new TestScheduler((a, b) => observableMatcher(a, b, get("assert"), get("assertDeepEqual")));
const context = new Context(testScheduler);
test.apply(null, [context].concat(args));
testScheduler.flush();
if (context.autoFlush) {
testScheduler.flush();
}
};
}

0 comments on commit 5f9ff6a

Please sign in to comment.