Skip to content

Commit

Permalink
pull in test from jestjs#11278
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 20, 2021
1 parent f499edc commit e5bd74f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions e2e/__tests__/detectOpenHandles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,14 @@ it('does not print info about open handlers for a server that is already closed'

expect(wrap(textAfterTest)).toMatchSnapshot();
});

it('does not report crypto random data', () => {
// The test here is basically that it exits cleanly without reporting anything (does not need `until`)
const {stderr} = runJest('detect-open-handles', [
'crypto',
'--detectOpenHandles',
]);
const textAfterTest = getTextAfterTest(stderr);

expect(textAfterTest).toBe('');
});
13 changes: 13 additions & 0 deletions e2e/detect-open-handles/__tests__/crypto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const {randomFillSync} = require('crypto');

test('randomFillSync()', () => {
const buf = Buffer.alloc(10);
randomFillSync(buf);
});

0 comments on commit e5bd74f

Please sign in to comment.