Skip to content

Commit

Permalink
update vitest and node version
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jul 7, 2024
1 parent eb7c025 commit c0e4f43
Show file tree
Hide file tree
Showing 83 changed files with 3,390 additions and 4,851 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [16.17.1]
node-version: [20.12.2]

steps:
- uses: actions/checkout@v2
Expand Down
7,882 changes: 3,209 additions & 4,673 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@types/benchmark": "^1.0.31",
"@types/chai": "^3.5.2",
"@types/glob": "^7.1.3",
"@types/node": "^12.6.8",
"@types/node": "^20.14.10",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@vitest/coverage-istanbul": "^0.30.1",
"@vitest/coverage-istanbul": "^1.6.0",
"benchmark": "2.1.4",
"docs-ts": "^0.8.0",
"dtslint": "github:gcanti/dtslint",
Expand All @@ -60,7 +60,7 @@
"ts-node": "^8.0.2",
"tslint": "5.11.0",
"typescript": "^5.5.2",
"vitest": "^0.30.1"
"vitest": "^1.6.0"
},
"tags": [
"typescript",
Expand Down
2 changes: 1 addition & 1 deletion test/Alternative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as O from '../src/Option'
import * as S from '../src/Semigroup'
import * as U from './util'

describe.concurrent('Alternative', () => {
describe('Alternative', () => {
it('altAll', () => {
const altAll = _.altAll(O.Alternative)
U.deepStrictEqual(altAll([]), O.none)
Expand Down
2 changes: 1 addition & 1 deletion test/Applicative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as O from '../src/Option'
import * as RA from '../src/ReadonlyArray'
import * as U from './util'

describe.concurrent('Applicative', () => {
describe('Applicative', () => {
it('getApplicativeComposition', () => {
const AC = getApplicativeComposition(RA.Applicative, O.Applicative)
U.deepStrictEqual(AC.of(1), [O.some(1)])
Expand Down
2 changes: 1 addition & 1 deletion test/Apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as O from '../src/Option'
import * as RA from '../src/ReadonlyArray'
import * as U from './util'

describe.concurrent('Apply', () => {
describe('Apply', () => {
it('sequenceT', () => {
const sequenceTOption = sequenceT(O.Applicative)
U.deepStrictEqual(sequenceTOption(O.some(1)), O.some([1]))
Expand Down
10 changes: 5 additions & 5 deletions test/Array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import * as U from './util'

/* tslint:disable:readonly-array */

describe.concurrent('Array', () => {
describe.concurrent('pipeables', () => {
describe('Array', () => {
describe('pipeables', () => {
it('traverse', () => {
const traverse = _.traverse(O.Applicative)((n: number): O.Option<number> => (n % 2 === 0 ? O.none : O.some(n)))
U.deepStrictEqual(traverse([1, 2]), O.none)
Expand Down Expand Up @@ -82,7 +82,7 @@ describe.concurrent('Array', () => {
})
})

describe.concurrent('pipeables', () => {
describe('pipeables', () => {
it('map', () => {
U.deepStrictEqual(
pipe(
Expand Down Expand Up @@ -941,7 +941,7 @@ describe.concurrent('Array', () => {
assertSplitAt(empty, 3, empty, [])
})

describe.concurrent('chunksOf', () => {
describe('chunksOf', () => {
it('should split an array into length-n pieces', () => {
U.deepStrictEqual(_.chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])
U.deepStrictEqual(_.chunksOf(2)([1, 2, 3, 4, 5, 6]), [
Expand Down Expand Up @@ -1162,7 +1162,7 @@ describe.concurrent('Array', () => {
U.deepStrictEqual(pipe([1, 2, 3], _.copy), [1, 2, 3])
})

describe.concurrent('fromPredicate', () => {
describe('fromPredicate', () => {
it('can create an array from a Refinement', () => {
const refinement: Refinement<unknown, string> = (a): a is string => typeof a === 'string'
U.deepStrictEqual(_.fromPredicate(refinement)('hello'), ['hello'])
Expand Down
2 changes: 1 addition & 1 deletion test/BooleanAlgebra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as B from '../src/boolean'
import * as _ from '../src/BooleanAlgebra'
import * as U from './util'

describe.concurrent('BooleanAlgebra', () => {
describe('BooleanAlgebra', () => {
it('booleanAlgebraBoolean', () => {
const BA = _.booleanAlgebraBoolean
U.deepStrictEqual(BA.implies(true, true), true)
Expand Down
2 changes: 1 addition & 1 deletion test/Bounded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as _ from '../src/Bounded'
import * as N from '../src/number'
import * as U from './util'

describe.concurrent('Bounded', () => {
describe('Bounded', () => {
it('clamp', () => {
const B: _.Bounded<number> = {
...N.Ord,
Expand Down
2 changes: 1 addition & 1 deletion test/BoundedDistributiveLattice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getMinMaxBoundedDistributiveLattice } from '../src/BoundedDistributiveL
import * as N from '../src/number'
import * as U from './util'

describe.concurrent('BoundedDistributiveLattice', () => {
describe('BoundedDistributiveLattice', () => {
it('getMinMaxBoundedDistributiveLattice', () => {
const BDL = getMinMaxBoundedDistributiveLattice(N.Ord)(0, 1)
U.deepStrictEqual(BDL.join(0.2, 0.4), 0.4)
Expand Down
2 changes: 1 addition & 1 deletion test/Choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { left, right } from '../src/Either'
import * as R from '../src/Reader'
import * as U from './util'

describe.concurrent('Choice', () => {
describe('Choice', () => {
it('splitChoice', () => {
const ab = (s: string) => s.length
const cd = (n: number) => n >= 2
Expand Down
2 changes: 1 addition & 1 deletion test/Compactable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as RA from '../src/ReadonlyArray'
import { separated } from '../src/Separated'
import * as U from './util'

describe.concurrent('Compactable', () => {
describe('Compactable', () => {
it('getCompactableComposition', () => {
const C = getCompactableComposition(RA.Functor, { ...RA.Functor, ...RA.Compactable })
U.deepStrictEqual(
Expand Down
2 changes: 1 addition & 1 deletion test/Console.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { error, info, log, warn } from '../src/Console'
import * as U from './util'

describe.concurrent('Console', () => {
describe('Console', () => {
it('log', () => {
const log_ = console.log
const logger: Array<any> = []
Expand Down
4 changes: 2 additions & 2 deletions test/Const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import * as N from '../src/number'
import * as S from '../src/string'
import * as U from './util'

describe.concurrent('Const', () => {
describe.concurrent('pipeables', () => {
describe('Const', () => {
describe('pipeables', () => {
it('map', () => {
const fa = _.make('foo')
U.deepStrictEqual(pipe(fa, _.map(U.double)), fa)
Expand Down
2 changes: 1 addition & 1 deletion test/Date.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from '../src/Date'
import * as U from './util'

describe.concurrent('Date', () => {
describe('Date', () => {
// -------------------------------------------------------------------------------------
// instances
// -------------------------------------------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions test/Either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import * as S from '../src/string'
import * as T from '../src/Task'
import * as U from './util'

describe.concurrent('Either', () => {
describe.concurrent('pipeables', () => {
describe('Either', () => {
describe('pipeables', () => {
it('mapLeft', () => {
U.deepStrictEqual(pipe(_.right('bar'), _.mapLeft(U.double)), _.right('bar'))
U.deepStrictEqual(pipe(_.left(2), _.mapLeft(U.double)), _.left(4))
Expand Down Expand Up @@ -328,7 +328,7 @@ describe.concurrent('Either', () => {
U.deepStrictEqual(_.parseJSON('{"a":1}', _.toError), _.right({ a: 1 }))
U.deepStrictEqual(
_.parseJSON('{"a":}', _.toError),
_.left(new SyntaxError('Unexpected token } in JSON at position 5'))
_.left(new SyntaxError(`Unexpected token '}', "{"a":}" is not valid JSON`))
)
})

Expand Down Expand Up @@ -409,7 +409,7 @@ describe.concurrent('Either', () => {
)
})

describe.concurrent('getEq', () => {
describe('getEq', () => {
it('equals', () => {
const equals = _.getEq(S.Eq, N.Eq).equals
U.deepStrictEqual(equals(_.right(1), _.right(1)), true)
Expand All @@ -421,7 +421,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('ChainRec', () => {
describe('ChainRec', () => {
it('chainRec', () => {
const chainRec = _.ChainRec.chainRec
U.deepStrictEqual(
Expand All @@ -445,7 +445,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getWitherable', () => {
describe('getWitherable', () => {
const W = _.getWitherable(S.Monoid)
const p = (n: number) => n > 2

Expand Down Expand Up @@ -504,7 +504,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getSemigroup', () => {
describe('getSemigroup', () => {
it('concat', () => {
const S = _.getSemigroup(N.SemigroupSum)
U.deepStrictEqual(S.concat(_.left('a'), _.left('b')), _.left('a'))
Expand All @@ -514,7 +514,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getApplySemigroup', () => {
describe('getApplySemigroup', () => {
it('concat', () => {
const S = _.getApplySemigroup(N.SemigroupSum)
U.deepStrictEqual(S.concat(_.left('a'), _.left('b')), _.left('a'))
Expand All @@ -524,7 +524,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getApplyMonoid', () => {
describe('getApplyMonoid', () => {
it('concat', () => {
const M = _.getApplyMonoid(N.MonoidSum)
U.deepStrictEqual(M.concat(_.left('a'), M.empty), _.left('a'))
Expand All @@ -534,7 +534,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getShow', () => {
describe('getShow', () => {
it('show', () => {
const Sh = _.getShow(S.Show, S.Show)
U.deepStrictEqual(Sh.show(_.left('a')), `left("a")`)
Expand Down Expand Up @@ -661,7 +661,7 @@ describe.concurrent('Either', () => {
U.deepStrictEqual(f(_.left('a')), _.left('a'))
})

describe.concurrent('array utils', () => {
describe('array utils', () => {
const input: ReadonlyNonEmptyArray<string> = ['a', 'b']

it('traverseReadonlyArrayWithIndex', () => {
Expand All @@ -678,7 +678,7 @@ describe.concurrent('Either', () => {
})
})

describe.concurrent('getCompactable', () => {
describe('getCompactable', () => {
const C = _.getCompactable(S.Monoid)
it('compact', () => {
U.deepStrictEqual(C.compact(_.left('1')), _.left('1'))
Expand Down
2 changes: 1 addition & 1 deletion test/EitherT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getEitherM } from '../src/EitherT'
import * as I from '../src/IO'
import * as U from './util'

describe.concurrent('EitherT', () => {
describe('EitherT', () => {
const T = getEitherM(I.Monad)

it('fold', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Endomorphism.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from '../src/Endomorphism'
import * as U from './util'

describe.concurrent('Endomorphism', () => {
describe('Endomorphism', () => {
it('getMonoid', () => {
const M = _.getMonoid<number>()
const inc = (n: number) => n + 1
Expand Down
4 changes: 2 additions & 2 deletions test/Eq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as N from '../src/number'
import * as S from '../src/string'
import * as U from './util'

describe.concurrent('Eq', () => {
describe.concurrent('pipeables', () => {
describe('Eq', () => {
describe('pipeables', () => {
it('contramap', () => {
const E = pipe(
S.Eq,
Expand Down
2 changes: 1 addition & 1 deletion test/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as _ from '../src/Field'
import * as N from '../src/number'
import * as U from './util'

describe.concurrent('Field', () => {
describe('Field', () => {
it('gcd', () => {
const gcdNumber = _.gcd(N.Eq, N.Field)
U.deepStrictEqual(gcdNumber(10, 5), 5)
Expand Down
2 changes: 1 addition & 1 deletion test/Filterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as RA from '../src/ReadonlyArray'
import { separated } from '../src/Separated'
import * as U from './util'

describe.concurrent('Filterable', () => {
describe('Filterable', () => {
it('getFilterableComposition', () => {
const F = getFilterableComposition(RA.Functor, RA.Filterable)

Expand Down
2 changes: 1 addition & 1 deletion test/Foldable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const ArrayOptionURI = 'ArrayOption'

export type ArrayOptionURI = typeof ArrayOptionURI

describe.concurrent('Foldable', () => {
describe('Foldable', () => {
it('getFoldableComposition', () => {
const F = _.getFoldableComposition(RA.Foldable, O.Foldable)
// reduce
Expand Down
2 changes: 1 addition & 1 deletion test/FoldableWithIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as RA from '../src/ReadonlyArray'
import * as S from '../src/string'
import * as U from './util'

describe.concurrent('FoldableWithIndex', () => {
describe('FoldableWithIndex', () => {
it('getFoldableWithIndexComposition', () => {
const arrayOfArray = getFoldableWithIndexComposition(RA.FoldableWithIndex, RA.FoldableWithIndex)
const fa: ReadonlyArray<ReadonlyArray<string>> = [
Expand Down
2 changes: 1 addition & 1 deletion test/Functor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as option from '../src/Option'
import * as RA from '../src/ReadonlyArray'
import * as U from './util'

describe.concurrent('Functor', () => {
describe('Functor', () => {
it('getFunctorComposition', () => {
const arrayOption = getFunctorComposition(RA.Functor, option.Functor)
U.deepStrictEqual(arrayOption.map([option.some(1)], U.double), [option.some(2)])
Expand Down
2 changes: 1 addition & 1 deletion test/FunctorWithIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getFunctorWithIndexComposition } from '../src/FunctorWithIndex'
import * as RA from '../src/ReadonlyArray'
import * as U from './util'

describe.concurrent('FunctorWithIndex', () => {
describe('FunctorWithIndex', () => {
it('getFunctorComposition', () => {
const FWI = getFunctorWithIndexComposition(RA.FunctorWithIndex, RA.FunctorWithIndex)
const f = ([i, j]: readonly [number, number], a: string) => a + i + j
Expand Down
6 changes: 3 additions & 3 deletions test/IO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as RA from '../src/ReadonlyArray'
import { ReadonlyNonEmptyArray } from '../src/ReadonlyNonEmptyArray'
import * as U from './util'

describe.concurrent('IO', () => {
describe.concurrent('pipeables', () => {
describe('IO', () => {
describe('pipeables', () => {
it('map', () => {
U.deepStrictEqual(pipe(_.of(1), _.map(U.double))(), 2)
})
Expand Down Expand Up @@ -95,7 +95,7 @@ describe.concurrent('IO', () => {
U.deepStrictEqual(pipe(_.of(1), _.bindTo('a'), _.apS('b', _.of('b')))(), { a: 1, b: 'b' })
})

describe.concurrent('array utils', () => {
describe('array utils', () => {
const input: ReadonlyNonEmptyArray<string> = ['a', 'b']

it('traverseReadonlyArrayWithIndex', () => {
Expand Down
Loading

0 comments on commit c0e4f43

Please sign in to comment.