Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / chain-able-deps   js

Repository URL to install this package:

Version: 6.0.4 

/ src / fp / __tests__ / flip.ts

import flip from '../../fp/flip'

function threeArgs(one, two, three) {
  return [one, two, three]
}

test('typings', () => {
  const stringNumber = (one: string, two: number) => false
  const numberString = flip(stringNumber)
})

test('flips fosho', () => {
  const oneTwoThree = ($1, $2, $3) => {
    const flipped = flip(threeArgs)
    const actual = flipped($1, $2, $3)
    const usual = threeArgs($1, $2, $3)

    // flipped 1 & 2 (same as .slice.reverse)
    // expect(actual[0]).toEqual(usual[1])
    // expect(actual[1]).toEqual(usual[2])

    // only flips 2 <- disabled this
    // expect(actual[2]).toEqual(usual[2])
    expect(actual.reverse()).toEqual(usual)
  }

  oneTwoThree(1, 2, 3)
})