Add Node.js 19 to CI
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 ca71e1e · Browse files · 4 files·+26 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+26 added−20 removed
- tests:+24 added−19 removed
- other:+2 added−1 removed
Provenance
- Commit
e473cc6- Tree
5f05da9- Author
Andrey Sitnik <andrey@sitnik.ru>- Committer
Andrey Sitnik <andrey@sitnik.ru>- Parent
ca71e1e
4 files changed+26 added−20 removed
modified:.github/workflows/test.yml+2 added-1 removed
18 unmodified lines192021222323242526274 unmodified lines32333435363738394036 unmodified lines18 unmodified lines version: latest - name: Install Node.js uses: actions/setup-node@v3 with: node-version: 18 node-version: 19 cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts - name: Run tests4 unmodified lines runs-on: ubuntu-latest strategy: matrix: node-version: - 18 - 16 - 14 name: Node.js ${{ matrix.node-version }} Quick steps:36 unmodified linesmodified:test/async.test.js+8 added-6 removed
3 unmodified lines4 import { urlAlphabet } from '../index.js'5 import * as browser from '../async/index.browser.js'6 import * as node from '../async/index.js'7 8+Object.defineProperty(global, 'crypto', {8-global.crypto = {9- getRandomValues(array) {10- for (let i = 0; i < array.length; i++) {11- array[i] = Math.floor(Math.random() * 256)9+ value: {10+ getRandomValues(array) {11+ for (let i = 0; i < array.length; i++) {12+ array[i] = Math.floor(Math.random() * 256)13+ }14+ return array15 }13- return array16 }15-}17+})18 19 function times(size, callback) {20 let array = []21 for (let i = 0; i < size; i++) {119 unmodified linesmodified:test/index.test.js+8 added-6 removed
3 unmodified lines4 import * as browser from '../index.browser.js'5 import * as node from '../index.js'6 7 test.before(() => {8+ Object.defineProperty(global, 'crypto', {8- global.crypto = {9- getRandomValues(array) {10- for (let i = 0; i < array.length; i++) {11- array[i] = Math.floor(Math.random() * 256)9+ value: {10+ getRandomValues(array) {11+ for (let i = 0; i < array.length; i++) {12+ array[i] = Math.floor(Math.random() * 256)13+ }14+ return array15 }13- return array16 }15- }17+ })18 })19 20 test.after(() => {21 delete global.crypto176 unmodified linesmodified:test/react-native-polyfill.test.js+8 added-7 removed
6 unmodified lines78910111112131412131415161718161918202122232423252627283 unmodified lines6 unmodified lines global.navigator = { product: 'ReactNative' }
Object.defineProperty(global, 'crypto', { global.crypto = { getRandomValues(array) { for (let i = 0; i < array.length; i++) { array[i] = Math.floor(Math.random() * 256) value: { getRandomValues(array) { for (let i = 0; i < array.length; i++) { array[i] = Math.floor(Math.random() * 256) } return array } return array } } })})
test.after(() => { delete global.navigator delete global.crypto})
test('works with polyfill', () => { is(typeof nanoid(), 'string')3 unmodified lines