mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-13 01:54:52 +08:00
This removes the pattern
```js
const {assert} = chai;
```
from our unit test suite, which is fundamentally incompatible with
TypeScript `asserts`, which we intend to put onto Chai assert
functions. And this is also unnecessary, since `karma-chai` (and
also `karma-chai-sinon`) already provide `assert` as a global (with
the proper types).
Bug: 333520272
Change-Id: Id5dfd65903b5b116414709782c7923fc5523e480
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5439575
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
30 lines
1006 B
TypeScript
30 lines
1006 B
TypeScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import * as Common from './common.js';
|
|
|
|
const StringOutputStream = Common.StringOutputStream.StringOutputStream;
|
|
|
|
describe('StringOutputStream', () => {
|
|
it('can be instantiated without issues', () => {
|
|
const stream = new StringOutputStream();
|
|
assert.strictEqual(stream.data(), '', 'data is not empty');
|
|
});
|
|
|
|
it('can be closed without issues', async () => {
|
|
const stream = new StringOutputStream();
|
|
await stream.close();
|
|
assert.strictEqual(stream.data(), '', 'data is not empty');
|
|
});
|
|
|
|
it('can be written to without issues', async () => {
|
|
const stream = new StringOutputStream();
|
|
await stream.write('Hello');
|
|
await stream.write(' ');
|
|
await stream.write('world!');
|
|
await stream.close();
|
|
assert.strictEqual(stream.data(), 'Hello world!', 'data does not match what was written');
|
|
});
|
|
});
|