hunk.code_window:       if (config === null) {
           throw new SilentError('No config found. If you want to use global configuration, '
             + 'you need the --global argument.');
         }
         if (!rawArgs[0]) {
           throw new SilentError('No key specified. Run "ng help get" for usage.');
         }
         const value = config.get(rawArgs[0]);
         if (value === null || value === undefined) {
           throw new SilentError('Value cannot be found.');
  
hunk.labels: keep keep keep keep keep replace replace replace replace keep keep keep keep
hunk.file_path: packages/@angular/cli/commands/get.ts
hunk.type: replace
file: import {oneLineTrim} from 'common-tags';
  import {BaseHrefWebpackPlugin} from './base-href-webpack-plugin';
  
  
  function mockCompiler(indexHtml: string, callback: Function) {
    return {
      plugin: function (_event: any, compilerCallback: Function) {
        const compilation = {
          plugin: function (_hook: any, compilationCallback: Function) {
            const htmlPluginData = {
              html: indexHtml
            };
            compilationCallback(htmlPluginData, callback);
          }
        };
        compilerCallback(compilation);
      }
    };
  }
  
  describe('base href webpack plugin', () => {
    const html = oneLineTrim`
      <html>
        <head></head>
        <body></body>
      </html>
    `;
  
    it('should do nothing when baseHref is null', () => {
      const plugin = new BaseHrefWebpackPlugin({ baseHref: null });
  
      const compiler = mockCompiler(html, (_x: any, htmlPluginData: any) => {
        expect(htmlPluginData.html).toEqual('<body><head></head></body>');
      });
      plugin.apply(compiler);
    });
  
    it('should insert base tag when not exist', function () {
      const plugin = new BaseHrefWebpackPlugin({ baseHref: '/' });
      const compiler = mockCompiler(html, (_x: any, htmlPluginData: any) => {
          expect(htmlPluginData.html).toEqual(oneLineTrim`
            <html>
              <head><base href="/"></head>
              <body></body>
            </html>
          `);
        });
  
      plugin.apply(compiler);
    });
  
    it('should replace href attribute when base tag already exists', function () {
      const plugin = new BaseHrefWebpackPlugin({ baseHref: '/myUrl/' });
  
      const compiler = mockCompiler(oneLineTrim`
            <head><base href="/" target="_blank"></head>
            <body></body>
          `, (_x: any, htmlPluginData: any) => {
        expect(htmlPluginData.html).toEqual(oneLineTrim`
            <head><base href="/myUrl/" target="_blank"></head>
            <body></body>
          `);
      });
      plugin.apply(compiler);
    });
  });
  