import { ConfigSchema } from './schema' ; describe ( 'ConfigSchema' , ( ) => { it ( `should produce correct config for context {"dev": false,"dist": false}` , ( ) => { expect ( ConfigSchema . validate ( { } , { dev : false , dist : false } ) ) . toMatchInlineSnapshot ( `
      Object {
        "browser": Object {
          "autoDownload": true,
          "chromium": Object {
            "proxy": Object {
              "enabled": false,
            },
          },
        },
        "networkPolicy": Object {
          "enabled": true,
          "rules": Array [
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "http:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "https:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "ws:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "wss:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "data:",
            },
            Object {
              "allow": false,
              "host": undefined,
              "protocol": undefined,
            },
          ],
        },
      }
    ` ) ; } ) ; it ( `should produce correct config for context {"dev": false,"dist": true}` , ( ) => { expect ( ConfigSchema . validate ( { } , { dev : false , dist : true } ) ) . toMatchInlineSnapshot ( `
      Object {
        "browser": Object {
          "autoDownload": false,
          "chromium": Object {
            "inspect": false,
            "proxy": Object {
              "enabled": false,
            },
          },
        },
        "networkPolicy": Object {
          "enabled": true,
          "rules": Array [
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "http:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "https:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "ws:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "wss:",
            },
            Object {
              "allow": true,
              "host": undefined,
              "protocol": "data:",
            },
            Object {
              "allow": false,
              "host": undefined,
              "protocol": undefined,
            },
          ],
        },
      }
    ` ) ; } ) ; it ( `should allow optional settings` , ( ) => { const config = ConfigSchema . validate ( { browser : { chromium : { disableSandbox : true } } } ) ; expect ( config ) . toHaveProperty ( 'browser.chromium' , { disableSandbox : true , proxy : { enabled : false } , } ) ; } ) ; it ( 'should allow setting a wildcard for chrome proxy bypass' , ( ) => { expect ( ConfigSchema . validate ( { browser : { chromium : { proxy : { enabled : true , server : 'http://example.com:8080' , bypass : [ '*.example.com' , '*bar.example.com' , 'bats.example.com' ] , } , } , } , } ) . browser . chromium . proxy ) . toMatchInlineSnapshot ( `
      Object {
        "bypass": Array [
          "*.example.com",
          "*bar.example.com",
          "bats.example.com",
        ],
        "enabled": true,
        "server": "http://example.com:8080",
      }
    ` ) ; } ) ; } ) ;