Skip to content
Snippets Groups Projects
Select Git revision
  • 1ee965f963c0eee097f5cb9bcf79c8a06f20abe4
  • main default
  • penenadpi/config-man
  • penenadpi/visualization-extension
  • penenadpi/visulization-html-extended
  • penenadpi/result-persistence
  • penenadpi/result-filter-fix-files
  • penenadpi/result-filter-fix
  • y1
  • 0.1.9
  • 0.1.8
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
  • 0.0.9
  • 0.0.8
  • 0.0.7
  • 0.0.6
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
28 results

scan_runner.py

Blame
  • error.spec.js 987 B
    const { handleError } = require('../../../lib/workers/repository/error');
    
    jest.mock('../../../lib/workers/repository/error-config');
    
    let config;
    beforeEach(() => {
      jest.resetAllMocks();
      config = require('../../_fixtures/config');
    });
    
    describe('workers/repository/error', () => {
      describe('handleError()', () => {
        const errors = [
          'uninitiated',
          'disabled',
          'repository-changed',
          'fork',
          'no-package-files',
          'config-validation',
          'registry-failure',
          'archived',
          'renamed',
          'blocked',
          'not-found',
          'forbidden',
          'rate-limit-exceeded',
        ];
        errors.forEach(err => {
          it(`errors ${err}`, async () => {
            const res = await handleError(config, new Error(err));
            expect(res).toEqual(err);
          });
        });
        it('handles unknown error', async () => {
          const res = await handleError(config, new Error('abcdefg'));
          expect(res).toEqual('unknown-error');
        });
      });
    });