Esempio n. 1
0
    it('does not convert spec when string', () => {
      const options = {
        spec: 'x,y,z',
      }

      snapshot('spec_as_string', normalizeModuleOptions(options))
    })
Esempio n. 2
0
    it('does not change other properties', () => {
      const options = {
        foo: 'bar',
      }

      snapshot('others_unchanged', normalizeModuleOptions(options))
    })
Esempio n. 3
0
    it('passes string env unchanged', () => {
      const options = {
        env: 'foo=bar',
      }

      snapshot('env_as_string', normalizeModuleOptions(options))
    })
 it('handles several tags', function () {
   const releases = {
     name: 'ci-publish',
     versions: ['1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.1.0'],
     timestamps: [
       '2016-01-07T20:49:10.977Z',
       '2016-01-07T20:54:08.557Z',
       '2016-01-07T20:59:05.577Z',
       '2016-01-07T21:15:00.188Z',
       '2016-01-07T21:15:40.930Z',
       '2016-01-08T03:27:18.522Z'
     ],
     'dist-tags': {
       latest: '1.1.0',
       dev: '1.1.0',
       old: '1.0.0'
     }
   }
   const options = {
     now: moment('2018-06-01')
   }
   const human = toHuman(releases, options)
   la(human.length === releases.versions.length, 'wrong number of versions')
   checkOutput(human)
   snapshot(human)
 })
Esempio n. 5
0
 it('does not remove --record option when using --browser', () => {
   const args = run.processRunOptions({
     record: 'foo',
     browser: 'test browser',
   })
   snapshot(args)
 })
Esempio n. 6
0
        .then(() => {
          expect(download.start).not.to.be.called

          snapshot(
            'skip installation',
            normalize(this.stdout.toString())
          )
        })
Esempio n. 7
0
 it('simple-icons javascript logo default color (#F7DF1E)', function() {
   const svg = makeBadge({
     text: ['label', 'message'],
     format: 'svg',
     logo: 'javascript',
   })
   snapshot(svg)
 })
Esempio n. 8
0
      it('logs noop message', function () {
        expect(download.start).not.to.be.called

        snapshot(
          'version already installed',
          normalize(this.stdout.toString())
        )
      })
Esempio n. 9
0
 it('shields GitHub logo default color (#333333)', function() {
   const svg = makeBadge({
     text: ['label', 'message'],
     format: 'svg',
     logo: 'github',
   })
   snapshot(svg)
 })
Esempio n. 10
0
 it('simple-icons javascript logo custom color (rgba(46,204,113,0.8))', function() {
   const svg = makeBadge({
     text: ['label', 'message'],
     format: 'svg',
     logo: 'javascript',
     logoColor: 'rgba(46,204,113,0.8)',
   })
   snapshot(svg)
 })
Esempio n. 11
0
 it('shields GitHub logo custom color (whitesmoke)', function() {
   const svg = makeBadge({
     text: ['label', 'message'],
     format: 'svg',
     logo: 'github',
     logoColor: 'whitesmoke',
   })
   snapshot(svg)
 })
Esempio n. 12
0
 it('converts reporterOptions object', () => {
   const options = {
     reporterOptions: {
       mochaFile: 'results/my-test-output.xml',
       toConsole: true,
     },
   }
   snapshot('reporter_options_as_object', normalizeModuleOptions(options))
 })
Esempio n. 13
0
 it('converts config object', () => {
   const options = {
     config: {
       baseUrl: 'http://localhost:2000',
       watchForFileChanges: false,
     },
   }
   snapshot('config_as_object', normalizeModuleOptions(options))
 })
Esempio n. 14
0
    it('converts specs array', () => {
      const options = {
        spec: [
          'a', 'b', 'c',
        ],
      }

      snapshot('spec_as_array', normalizeModuleOptions(options))
    })
Esempio n. 15
0
 it('converts environment object', () => {
   const options = {
     env: {
       foo: 'bar',
       magicNumber: 1234,
       host: 'kevin.dev.local',
     },
   }
   snapshot('env_as_object', normalizeModuleOptions(options))
 })
 it('gets main badges', () => {
   const options = {
     name: 'test-example',
     repoName: 'test-repo',
     username: '******',
     npmBadge: true,
     travisBadge: true,
     semanticReleaseBadge: true,
     standardBadge: true
   }
   const urls = getBadges(options)
   snapshot(urls)
 })
Esempio n. 17
0
      it('logs message and starts download', function () {
        expect(download.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        expect(unzip.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        snapshot(
          'continues installing on failure',
          normalize(this.stdout.toString())
        )
      })
 it('can include renovate app', () => {
   const options = {
     name: 'test-example',
     repoName: 'test-repo',
     username: '******',
     npmBadge: true,
     travisBadge: true,
     semanticReleaseBadge: true,
     standardBadge: true,
     renovateBadge: true
   }
   const urls = getBadges(options)
   snapshot(urls)
 })
Esempio n. 19
0
      it('logs global warning and download', function () {
        expect(download.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        expect(unzip.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        snapshot(
          'warning installing as global',
          normalize(this.stdout.toString())
        )
      })
Esempio n. 20
0
      it('logs message and starts download', function () {
        expect(download.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        expect(unzip.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        snapshot(
          'installed version does not match needed version',
          normalize(this.stdout.toString())
        )
      })
Esempio n. 21
0
        .then(() => {
          expect(download.start).to.be.calledWithMatch({
            version,
          })

          expect(unzip.start).to.be.calledWithMatch({
            version,
          })

          snapshot(
            'specify version in env vars',
            normalize(this.stdout.toString())
          )
        })
Esempio n. 22
0
      it('logs message and starts download', function () {
        expect(info.clearVersionState).to.be.called

        expect(download.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        expect(unzip.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        snapshot(
          'forcing true always installs',
          normalize(this.stdout.toString())
        )
      })
Esempio n. 23
0
    it('parses given output', () => {
      stubSpawnOnce(
        'git log --pretty=full',
        0,
        stripIndent`
        commit aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        Author: Gleb Bahmutov <*****@*****.**>
        Commit: Gleb Bahmutov <*****@*****.**>

            first commit

        commit bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
        Author: Gleb Bahmutov <*****@*****.**>
        Commit: Gleb Bahmutov <*****@*****.**>

            second commit
        `
      )
      return snapshot(commits.all())
    })
Esempio n. 24
0
      it('logs message and starts download', function () {
        expect(info.clearVersionState).to.be.called

        expect(download.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        expect(unzip.start).to.be.calledWithMatch({
          version: packageVersion,
        })

        // cleans up the zip file
        expect(fs.removeAsync).to.be.calledWith(
          downloadDestination.filename
        )

        snapshot(
          'installs without existing installation',
          normalize(this.stdout.toString())
        )
      })
Esempio n. 25
0
    it('returns latest desktop url', () => {
      const url = download.getUrl()

      snapshot('latest desktop url', normalize(url))
    })
Esempio n. 26
0
    .catch((err) => {
      logger.error(err)

      return snapshot('download status errors', normalize(ctx.stdout.toString()))
    })
Esempio n. 27
0
 it('should always produce the same SVG (unless we have changed something!)', function() {
   const svg = makeBadge({ text: ['cactus', 'grown'], format: 'svg' })
   snapshot(svg)
 })
Esempio n. 28
0
    it('returns specific desktop version url', () => {
      const url = download.getUrl('0.20.2')

      snapshot('specific version desktop url', normalize(url))
    })
Esempio n. 29
0
    it('env var with subdirectory', () => {
      process.env.CYPRESS_DOWNLOAD_MIRROR = 'https://cypress.example.com/example'
      const url = download.getUrl('0.20.2')

      snapshot('base url from CYPRESS_DOWNLOAD_MIRROR with subdirectory', normalize(url))
    })
Esempio n. 30
0
 it('passes --record option', () => {
   const args = run.processRunOptions({
     record: 'my record id',
   })
   snapshot(args)
 })