Skip to content
Myr

Another way to clean after tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Sitnik · committed by Andrey Sitnik · parent 264c25b · Browse files · 3 files+15 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+15 added−10 removed

  • tests:+15 added−10 removed

3 files+15 added−10 removed

modified:test/async.test.js+13 added-7 removed
modified:test/index.test.js+1 added-2 removed
4 unmodified lines
5import * as node from '../index.js'67test.before(() => {8 Object.defineProperty(global, 'crypto', {9 configurable: true,9 value: {10 getRandomValues(array) {11 for (let i = 0; i < array.length; i++) {12 array[i] = Math.floor(Math.random() * 256)
4 unmodified lines
17 })18})1920test.after(() => {22 delete global.crypto21 Object.defineProperty(global, 'crypto', { value: undefined })22})2324for (let type of ['node', 'browser']) {25 let { nanoid, customAlphabet, customRandom, random, urlAlphabet } =
172 unmodified lines
modified:test/react-native-polyfill.test.js+1 added-1 removed