Skip to content
Snippets Groups Projects
Select Git revision
  • dca3418bbdbf1024ac6807e591562b4042bc846d
  • main default protected
  • renovate/main-ghcr.io-renovatebot-base-image-11.x
  • defect/test-name
  • renovate/main-linters
  • feat/minimumReleaseAgeTimestamp-required
  • renovate/main-actions-setup-node-5.x
  • renovate/main-find-up-8.x
  • refactor/pin-new-value
  • fix/user-agent
  • feat/37517-base64-private-key
  • next
  • feat/gnupg
  • fix/36615b-branch-reuse-no-cache
  • chore/punycode
  • feat/36219--git-x509-signing
  • feat/structured-logger
  • hotfix/39.264.1
  • feat/skip-dangling
  • gh-readonly-queue/next/pr-36034-7a061c4ca1024a19e2c295d773d9642625d1c2be
  • hotfix/39.238.3
  • 41.141.0
  • 41.140.3
  • 41.140.2
  • 41.140.1
  • 41.140.0
  • 41.139.1
  • 41.139.0
  • 41.138.5
  • 41.138.4
  • 41.138.3
  • 41.138.2
  • 41.138.1
  • 41.138.0
  • 41.137.3
  • 41.137.2
  • 41.137.1
  • 41.137.0
  • 41.136.0
  • 41.135.8
  • 41.135.7
41 results

index.spec.ts

Blame
  • entrypoint.spec.js 704 B
    import { expect } from 'chai'
    import isSvg from 'is-svg'
    import got from './core/got-test-client.js'
    
    let serverModule
    before(async function () {
      this.timeout('30s')
      // remove args coming from mocha
      // https://github.com/badges/shields/issues/3365
      process.argv = []
      serverModule = await import('./server.js')
    })
    
    after('shut down the server', async function () {
      await serverModule.server.stop()
    })
    
    it('should render a badge', async function () {
      this.timeout('30s')
      const { statusCode, body } = await got(
        'http://localhost:1111/badge/fruit-apple-green.svg',
      )
      expect(statusCode).to.equal(200)
      expect(body).to.satisfy(isSvg).and.to.include('fruit').and.to.include('apple')
    })