{"version":3,"sources":["../src/validateAdapter.js"],"names":["validateAdapter","adapter","Error","Object","getPrototypeOf","EnzymeAdapter"],"mappings":";;;;;qBAEwBA,e;;AAFxB;;;;;;AAEe,SAASA,eAAT,CAAyBC,OAAzB,EAAkC;AAC/C,MAAI,CAACA,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,0fAAN;AAUD;AACD,MAAI,OAAOD,OAAP,KAAmB,UAAvB,EAAmC;AACjC,QAAIE,OAAOC,cAAP,CAAsBH,OAAtB,MAAmCI,0BAAvC,EAAsD;AACpD,YAAM,IAAIH,KAAJ,kjBAAN;AAWD;AACD,UAAM,IAAIA,KAAJ,yjBAAN;AAWD;AACD,MAAI,EAAED,mBAAmBI,0BAArB,CAAJ,EAAyC;AACvC,UAAM,IAAIH,KAAJ,CAAU,oGAAV,CAAN;AACD;AACF","file":"validateAdapter.js","sourcesContent":["import EnzymeAdapter from './EnzymeAdapter';\n\nexport default function validateAdapter(adapter) {\n if (!adapter) {\n throw new Error(`\n Enzyme Internal Error: Enzyme expects an adapter to be configured, but found none.\n To configure an adapter, you should call \\`Enzyme.configure({ adapter: new Adapter() })\\`\n before using any of Enzyme's top level APIs, where \\`Adapter\\` is the adapter\n corresponding to the library currently being tested. For example:\n\n import Adapter from 'enzyme-adapter-react-15';\n\n To find out more about this, see https://airbnb.io/enzyme/docs/installation/index.html\n `);\n }\n if (typeof adapter === 'function') {\n if (Object.getPrototypeOf(adapter) === EnzymeAdapter) {\n throw new Error(`\n Enzyme Internal Error: Enzyme expects an adapter instance to be configured -\n you provided an adapter *constructor*.\n To configure an adapter, you should call \\`Enzyme.configure({ adapter: new Adapter() })\\`\n before using any of Enzyme's top level APIs, where \\`Adapter\\` is the adapter\n corresponding to the library currently being tested. For example:\n\n import Adapter from 'enzyme-adapter-react-15';\n\n To find out more about this, see https://airbnb.io/enzyme/docs/installation/index.html\n `);\n }\n throw new Error(`\n Enzyme Internal Error: Enzyme expects an adapter to be configured -\n an enzyme adapter must be an object instance; you provided a function.\n To configure an adapter, you should call \\`Enzyme.configure({ adapter: new Adapter() })\\`\n before using any of Enzyme's top level APIs, where \\`Adapter\\` is the adapter\n corresponding to the library currently being tested. For example:\n\n import Adapter from 'enzyme-adapter-react-15';\n\n To find out more about this, see https://airbnb.io/enzyme/docs/installation/index.html\n `);\n }\n if (!(adapter instanceof EnzymeAdapter)) {\n throw new Error('Enzyme Internal Error: configured enzyme adapter did not inherit from the EnzymeAdapter base class');\n }\n}\n"]}