Skip to content

Commit

Permalink
added tests back
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Oct 10, 2019
1 parent 445585a commit 82cf46c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/integration/tests/file.spec.ts
Expand Up @@ -111,22 +111,22 @@ test('test file stream', async () => {

await test.stream('stream.txt', 'init');

// const fileContent = await test.content('stream.txt');
// fileContent.activateNextOnAppend();
//
// expect(fileContent).toBeInstanceOf(StreamBehaviorSubject);
// expect(fileContent.getValue()).toBe('init');
//
// test.stream('stream.txt', '\nupdated');
// await fileContent.nextStateChange;
// expect(fileContent.getValue()).toBe('init\nupdated');
//
// await fileContent.unsubscribe();
// await test.stream('stream.txt', '\nnext');
//
// await sleep(0.2);
// //content is still the same, since we unsubscribed
// expect(fileContent.value).toBe('init\nupdated');
const fileContent = await test.content('stream.txt');
fileContent.activateNextOnAppend();

expect(fileContent).toBeInstanceOf(StreamBehaviorSubject);
expect(fileContent.getValue()).toBe('init');

test.stream('stream.txt', '\nupdated');
await fileContent.nextStateChange;
expect(fileContent.getValue()).toBe('init\nupdated');

await fileContent.unsubscribe();
await test.stream('stream.txt', '\nnext');

await sleep(0.2);
//content is still the same, since we unsubscribed
expect(fileContent.value).toBe('init\nupdated');

await close();
});

0 comments on commit 82cf46c

Please sign in to comment.