How to use sazerac - 10 common examples

To help you get started, we’ve selected a few sazerac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github badges / shields / services / php-version.spec.js View on Github external
describe('Composer version comparison', function() {
  test(compare, () => {
    // composer version scheme ordering
    given('0.9.0', '1.0.0-alpha').expect(-1)
    given('1.0.0-alpha', '1.0.0-alpha2').expect(-1)
    given('1.0.0-alpha2', '1.0.0-beta').expect(-1)
    given('1.0.0-beta', '1.0.0-beta2').expect(-1)
    given('1.0.0-beta2', '1.0.0-RC').expect(-1)
    given('1.0.0-B2', '1.0.0-RC').expect(-1)
    given('1.0.0-RC', '1.0.0-RC2').expect(-1)
    given('1.0.0-RC2', '1.0.0').expect(-1)
    given('1.0.0-rc', '1.0.0').expect(-1)
    given('1.0.0', '1.0.0-patch').expect(-1)
    given('1.0.0-patch', '1.0.0-dev').expect(-1)
    given('1.0.0-dev', '1.0.1').expect(-1)
    given('1.0.1', '1.0.x-dev').expect(-1)

    // short versions should compare equal to long versions
github badges / shields / services / version.spec.js View on Github external
describe('Version helpers', function() {
  test(latest, () => {
    // semver-compatible versions.
    given(['1.0.0', '1.0.2', '1.0.1']).expect('1.0.2')
    given(['1.0.0', '2.0.0', '3.0.0']).expect('3.0.0')
    given(['0.0.1', '0.0.10', '0.0.2', '0.0.20']).expect('0.0.20')

    // "not-quite-valid" semver versions
    given(['1.0.00', '1.0.02', '1.0.01']).expect('1.0.02')
    given(['1.0.05', '2.0.05', '3.0.05']).expect('3.0.05')
    given(['0.0.01', '0.0.010', '0.0.02', '0.0.020']).expect('0.0.020')

    // Mixed style versions. - include pre-releases
    given(['1.0.0', 'v1.0.2', 'r1.0.1', 'release-2.0.0', 'v1.0.1-alpha.1'], {
      pre: includePre,
    }).expect('release-2.0.0')
    given(['1.0.0', 'v2.0.0', 'r1.0.1', 'release-1.0.3', 'v1.0.1-alpha.1'], {
      pre: includePre,
github badges / shields / services / version.spec.js View on Github external
describe('Version helpers', function() {
  test(latest, () => {
    // semver-compatible versions.
    given(['1.0.0', '1.0.2', '1.0.1']).expect('1.0.2')
    given(['1.0.0', '2.0.0', '3.0.0']).expect('3.0.0')
    given(['0.0.1', '0.0.10', '0.0.2', '0.0.20']).expect('0.0.20')

    // "not-quite-valid" semver versions
    given(['1.0.00', '1.0.02', '1.0.01']).expect('1.0.02')
    given(['1.0.05', '2.0.05', '3.0.05']).expect('3.0.05')
    given(['0.0.01', '0.0.010', '0.0.02', '0.0.020']).expect('0.0.020')

    // Mixed style versions. - include pre-releases
    given(['1.0.0', 'v1.0.2', 'r1.0.1', 'release-2.0.0', 'v1.0.1-alpha.1'], {
      pre: includePre,
    }).expect('release-2.0.0')
    given(['1.0.0', 'v2.0.0', 'r1.0.1', 'release-1.0.3', 'v1.0.1-alpha.1'], {
      pre: includePre,
github badges / shields / services / color-formatters.spec.js View on Github external
given('A').expect('brightgreen')
    given('B').expect('green')
    given('C').expect('yellowgreen')
    given('D').expect('yellow')
    given('E').expect('orange')
    given('F').expect('red')
    given('Z').expect('red')
  })

  const monthsAgo = months => {
    const result = new Date()
    // This looks wack but it works.
    result.setMonth(result.getMonth() - months)
    return result
  }
  test(age, () => {
    given(Date.now())
      .describe('when given the current timestamp')
      .expect('brightgreen')
    given(new Date())
      .describe('when given the current Date')
      .expect('brightgreen')
    given(new Date(2001, 1, 1))
      .describe('when given a Date many years ago')
      .expect('red')
    given(monthsAgo(2))
      .describe('when given a Date two months ago')
      .expect('yellowgreen')
    given(monthsAgo(15))
      .describe('when given a Date 15 months ago')
      .expect('orange')
  })
github badges / shields / lib / logos.spec.js View on Github external
test(isDataUrl, () => {
    //valid input
    given('data:image/svg+xml;base64,PHN2ZyB4bWxu').expect(true)

    // invalid inputs
    forCases([given('data:foobar'), given('foobar')]).expect(false)

    // attempted XSS attack
    given(
      'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="/>'
    ).expect(false)
  })
github badges / shields / core / service-test-runner / services-for-title.spec.js View on Github external
describe('Services from PR title', function() {
  test(servicesForTitle, () => {
    given('[Travis] Fix timeout issues').expect(['travis'])
    given('[Travis Sonar] Support user token authentication').expect([
      'travis',
      'sonar',
    ])
    given('[CRAN CPAN CTAN] Add test coverage').expect(['cran', 'cpan', 'ctan'])
    given(
      '[RFC] Add Joi-based request validation to BaseJsonService and rewrite [NPM] badges'
    ).expect(['npm'])
    given('make changes to [CRAN] and [CPAN]').expect(['cran', 'cpan'])
    given('[github appveyor ]').expect(['github', 'appveyor'])
  })
})
github badges / shields / core / base-service / coalesce.spec.js View on Github external
test(coalesce, function() {
    given().expect(undefined)
    given(null, []).expect([])
    given(null, [], {}).expect([])
    given(null, undefined, 0, {}).expect(0)

    const a = null,
      c = 0,
      d = 1
    let b
    given(a, b, c, d).expect(0)
  })
})
github badges / shields / core / base-service / coalesce.spec.js View on Github external
test(coalesce, function() {
    given().expect(undefined)
    given(null, []).expect([])
    given(null, [], {}).expect([])
    given(null, undefined, 0, {}).expect(0)

    const a = null,
      c = 0,
      d = 1
    let b
    given(a, b, c, d).expect(0)
  })
})
github badges / shields / services / text-formatters.spec.js View on Github external
test(formatRelativeDate, () => {
      given(new Date(2018, 9, 31).getTime() / 1000)
        .describe('when given the end of october')
        .expect('in 2 days')
    })
github badges / shields / services / text-formatters.spec.js View on Github external
test(formatDate, () => {
      given(new Date(2017, 0, 1).getTime())
        .describe('when given the beginning of this year')
        .expect('january')
    })
  })

sazerac

<p align="center"> <a href="http://sazerac.js.org" target="_blank"><img width="50" src="http://sazerac.js.org/images/logo.svg"></a> </p>

MIT
Latest version published 5 years ago

Package Health Score

54 / 100
Full package analysis

Popular sazerac functions