diff --git a/dist/interfaces.d.ts b/dist/interfaces.d.ts index f9c0c07..1d51001 100644 --- a/dist/interfaces.d.ts +++ b/dist/interfaces.d.ts @@ -1,30 +1,27 @@ import React, { Component } from 'react'; import Tester from './tester'; import ConfigurationClass from './ConfigurationClass'; -export declare type ComponentClass = React.FC | (new () => Component); +export declare type ComponentClass = React.FC | (new (props: any) => Component); export interface IMountOps { async?: boolean; } -export interface IWrapper { - component: ComponentClass; - name: string; - props: object; - renderChildren?: boolean; -} -export interface IHook extends IWrapper { +export declare type IOnBeforeMount = (tester: Tester, mountOpts?: IMountOps) => void | Promise; +export declare type IOnInit = (tester: Tester) => void; +export interface IBaseHook { [key: string]: any; - onBeforeMount: (tester: Tester, mountOpts?: IMountOps) => void | Promise; - onInit: (tester: Tester) => void; - props: object | (() => void); + name: string; + onBeforeMount?: IOnBeforeMount; + onInit?: IOnInit; shortCuts?: { [shortCutName: string]: () => void; }; - wrapper?: () => { - Component: ComponentClass; - name: string; - props: object; - }; } +export interface IWrapper extends IBaseHook { + component: ComponentClass; + props?: object | (() => void); + renderChildren?: boolean; +} +export declare type IHook = IBaseHook | IWrapper; export interface IProfile { [key: string]: boolean | string; name: string; diff --git a/dist/tester.cjs.js b/dist/tester.cjs.js index 1cfae36..27084b4 100644 --- a/dist/tester.cjs.js +++ b/dist/tester.cjs.js @@ -232,8 +232,9 @@ function () { } // Loop through hooks onInit(), - this.config.getValidHooks(this, 'onInit').forEach(function (hook) { - hook.onInit(_this); + var validHooks = this.config.getValidHooks(this, 'onInit'); + validHooks.forEach(function (hook) { + return hook.onInit(_this); }); } @@ -406,6 +407,7 @@ function () { /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() { var mountOpts, + validHooks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, @@ -421,73 +423,72 @@ function () { switch (_context4.prev = _context4.next) { case 0: mountOpts = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}; - // Loop through hooks onBeforeMount(), - // This MUST be a regular for () loop to not throw the promise away. (forEach won't work) + validHooks = this.config.getValidHooks(this, 'onBeforeMount'); _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; - _context4.prev = 4; - _iterator = this.config.getValidHooks(this, 'onBeforeMount')[Symbol.iterator](); + _context4.prev = 5; + _iterator = validHooks[Symbol.iterator](); - case 6: + case 7: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { - _context4.next = 13; + _context4.next = 14; break; } hook = _step.value; - _context4.next = 10; + _context4.next = 11; return hook.onBeforeMount(this, mountOpts); - case 10: + case 11: _iteratorNormalCompletion = true; - _context4.next = 6; + _context4.next = 7; break; - case 13: - _context4.next = 19; + case 14: + _context4.next = 20; break; - case 15: - _context4.prev = 15; - _context4.t0 = _context4["catch"](4); + case 16: + _context4.prev = 16; + _context4.t0 = _context4["catch"](5); _didIteratorError = true; _iteratorError = _context4.t0; - case 19: - _context4.prev = 19; + case 20: _context4.prev = 20; + _context4.prev = 21; if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } - case 22: - _context4.prev = 22; + case 23: + _context4.prev = 23; if (!_didIteratorError) { - _context4.next = 25; + _context4.next = 26; break; } throw _iteratorError; - case 25: - return _context4.finish(22); - case 26: - return _context4.finish(19); + return _context4.finish(23); case 27: + return _context4.finish(20); + + case 28: if (!this.onBeforeMount) { - _context4.next = 30; + _context4.next = 31; break; } - _context4.next = 30; + _context4.next = 31; return this.onBeforeMount(this); - case 30: + case 31: initialMount = this.initialMount || React__default.createElement(this.TestedComponent, this.props); WrapperTree = this.getWrappers().reduce(function (Tree, wrapper) { var wrapperChildren = wrapper.renderChildren !== false && Tree; @@ -498,10 +499,10 @@ function () { return Tree; }, initialMount); - _context4.next = 34; + _context4.next = 35; return this.config.enzyme.mount(WrapperTree); - case 34: + case 35: this.wrapper = _context4.sent; if (this.opts.shallow) { @@ -509,25 +510,25 @@ function () { } if (!mountOpts.async) { - _context4.next = 40; + _context4.next = 41; break; } - _context4.next = 39; + _context4.next = 40; return this.sleep(); - case 39: + case 40: this.update(); - case 40: + case 41: return _context4.abrupt("return", this); - case 41: + case 42: case "end": return _context4.stop(); } } - }, _callee4, this, [[4, 15, 19, 27], [20,, 22, 26]]); + }, _callee4, this, [[5, 16, 20, 28], [21,, 23, 27]]); })); function mount() { diff --git a/dist/tester.cjs.js.map b/dist/tester.cjs.js.map index b2dc500..3ccdaca 100644 --- a/dist/tester.cjs.js.map +++ b/dist/tester.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"tester.cjs.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n this.config.getValidHooks(this, 'onInit').forEach((hook: IHook) => {\n hook.onInit(this);\n });\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n for (const hook of this.config.getValidHooks(this, 'onBeforeMount')) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["React","Fragment","_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;AAGA,AAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACrC,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACpC,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;CAC7C;AACD,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;EACtC,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CAC5D;AACD,AAAO,SAAS,KAAK,GAAG;EACtB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;CACtC;;AAED,SAAS,MAAM,GAAG;EAChB,MAAM,GAAG,iBAAiB;;EAE1B,kBAAkB,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG;IACzC,IAAI,EAAE;QACF,KAAK,GAAG,SAAS,CAAC;IACtB,OAAO,kBAAkB,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,QAAQ,EAAE;MACzD,OAAO,CAAC,EAAE;QACR,QAAQ,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI;UACnC,KAAK,CAAC;YACJ,EAAE,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC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IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;QAChD,IAAI,KAAK,GAAG,IAAI,CAAC;;QAEjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;UAC9B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;UAC/B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,KAAK,EAAE;UACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;OACF,CAAC,CAAC;MACH,OAAO,KAAK,CAAC;KACd;GACF,CAAC,CAAC,CAAC;;EAEJ,OAAO,kBAAkB,CAAC;CAC3B,EAAE,CAAC;;AC/ID,IAAC,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;;;;;"} \ No newline at end of file +{"version":3,"file":"tester.cjs.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass, IOnInit, IOnBeforeMount } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n const validHooks = this.config.getValidHooks(this, 'onInit') as Array;\n validHooks.forEach(hook => hook.onInit(this));\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n type IValidHook = IHook & { onBeforeMount: IOnBeforeMount };\n const validHooks = this.config.getValidHooks(this, 'onBeforeMount') as IValidHook[];\n for (const hook of validHooks) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["React","Fragment","_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;AAGA,AAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACrC,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACpC,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;CAC7C;AACD,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;EACtC,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CAC5D;AACD,AAAO,SAAS,KAAK,GAAG;EACtB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;CACtC;;AAED,SAAS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G,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;MAE/C,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,eAAe,KAAK,SAAS,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC;OAC/G;;;;MAID,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC;KAC1C;GACF,EAAE;IACD,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE;MAC9C,IAAI,KAAK,GAAG,EAAE,CAAC;MACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;QAChD,IAAI,KAAK,GAAG,IAAI,CAAC;;QAEjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;UAC9B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;UAC/B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,KAAK,EAAE;UACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;OACF,CAAC,CAAC;MACH,OAAO,KAAK,CAAC;KACd;GACF,CAAC,CAAC,CAAC;;EAEJ,OAAO,kBAAkB,CAAC;CAC3B,EAAE,CAAC;;AC/ID,IAAC,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;;;;;"} \ No newline at end of file diff --git a/dist/tester.esm.js b/dist/tester.esm.js index d901aa1..73f6644 100644 --- a/dist/tester.esm.js +++ b/dist/tester.esm.js @@ -225,8 +225,9 @@ function () { } // Loop through hooks onInit(), - this.config.getValidHooks(this, 'onInit').forEach(function (hook) { - hook.onInit(_this); + var validHooks = this.config.getValidHooks(this, 'onInit'); + validHooks.forEach(function (hook) { + return hook.onInit(_this); }); } @@ -399,6 +400,7 @@ function () { /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() { var mountOpts, + validHooks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, @@ -414,73 +416,72 @@ function () { switch (_context4.prev = _context4.next) { case 0: mountOpts = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}; - // Loop through hooks onBeforeMount(), - // This MUST be a regular for () loop to not throw the promise away. (forEach won't work) + validHooks = this.config.getValidHooks(this, 'onBeforeMount'); _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; - _context4.prev = 4; - _iterator = this.config.getValidHooks(this, 'onBeforeMount')[Symbol.iterator](); + _context4.prev = 5; + _iterator = validHooks[Symbol.iterator](); - case 6: + case 7: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { - _context4.next = 13; + _context4.next = 14; break; } hook = _step.value; - _context4.next = 10; + _context4.next = 11; return hook.onBeforeMount(this, mountOpts); - case 10: + case 11: _iteratorNormalCompletion = true; - _context4.next = 6; + _context4.next = 7; break; - case 13: - _context4.next = 19; + case 14: + _context4.next = 20; break; - case 15: - _context4.prev = 15; - _context4.t0 = _context4["catch"](4); + case 16: + _context4.prev = 16; + _context4.t0 = _context4["catch"](5); _didIteratorError = true; _iteratorError = _context4.t0; - case 19: - _context4.prev = 19; + case 20: _context4.prev = 20; + _context4.prev = 21; if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } - case 22: - _context4.prev = 22; + case 23: + _context4.prev = 23; if (!_didIteratorError) { - _context4.next = 25; + _context4.next = 26; break; } throw _iteratorError; - case 25: - return _context4.finish(22); - case 26: - return _context4.finish(19); + return _context4.finish(23); case 27: + return _context4.finish(20); + + case 28: if (!this.onBeforeMount) { - _context4.next = 30; + _context4.next = 31; break; } - _context4.next = 30; + _context4.next = 31; return this.onBeforeMount(this); - case 30: + case 31: initialMount = this.initialMount || React.createElement(this.TestedComponent, this.props); WrapperTree = this.getWrappers().reduce(function (Tree, wrapper) { var wrapperChildren = wrapper.renderChildren !== false && Tree; @@ -491,10 +492,10 @@ function () { return Tree; }, initialMount); - _context4.next = 34; + _context4.next = 35; return this.config.enzyme.mount(WrapperTree); - case 34: + case 35: this.wrapper = _context4.sent; if (this.opts.shallow) { @@ -502,25 +503,25 @@ function () { } if (!mountOpts.async) { - _context4.next = 40; + _context4.next = 41; break; } - _context4.next = 39; + _context4.next = 40; return this.sleep(); - case 39: + case 40: this.update(); - case 40: + case 41: return _context4.abrupt("return", this); - case 41: + case 42: case "end": return _context4.stop(); } } - }, _callee4, this, [[4, 15, 19, 27], [20,, 22, 26]]); + }, _callee4, this, [[5, 16, 20, 28], [21,, 23, 27]]); })); function mount() { diff --git a/dist/tester.esm.js.map b/dist/tester.esm.js.map index d5c4ea8..4fda378 100644 --- a/dist/tester.esm.js.map +++ b/dist/tester.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"tester.esm.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n this.config.getValidHooks(this, 'onInit').forEach((hook: IHook) => {\n hook.onInit(this);\n });\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n for (const hook of this.config.getValidHooks(this, 'onBeforeMount')) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;AAGA,AAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACrC,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACpC,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;CAC7C;AACD,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;EACtC,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CAC5D;AACD,AAAO,SAAS,KAAK,GAAG;EACtB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;CACtC;;AAED,SAAS,MAAM,GAAG;EAChB,MAAM,GAAG,iBAAiB;;EAE1B,kBAAkB,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG;IACzC,IAAI,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BAAmB,CAAC,CAAC,CAAC;OAC/G;;;;MAID,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC;KAC1C;GACF,EAAE;IACD,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE;MAC9C,IAAI,KAAK,GAAG,EAAE,CAAC;MACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;QAChD,IAAI,KAAK,GAAG,IAAI,CAAC;;QAEjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;UAC9B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;UAC/B,KAAK,GAAG,KAAK,CAAC;SACf;;QAED,IAAI,KAAK,EAAE;UACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;OACF,CAAC,CAAC;MACH,OAAO,KAAK,CAAC;KACd;GACF,CAAC,CAAC,CAAC;;EAEJ,OAAO,kBAAkB,CAAC;CAC3B,EAAE,CAAC;;AC/ID,IAAC,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"tester.esm.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass, IOnInit, IOnBeforeMount } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n const validHooks = this.config.getValidHooks(this, 'onInit') as Array;\n validHooks.forEach(hook => hook.onInit(this));\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n type IValidHook = IHook & { onBeforeMount: IOnBeforeMount };\n const validHooks = this.config.getValidHooks(this, 'onBeforeMount') as IValidHook[];\n for (const hook of validHooks) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;AAGA,AAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACrC,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACpC,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;CAC7C;AACD,AAAO,S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kBAAkB,CAAC,MAAM,CAAC;;;;"} \ No newline at end of file diff --git a/dist/tester.umd.js b/dist/tester.umd.js index 6e2b6e2..c776031 100644 --- a/dist/tester.umd.js +++ b/dist/tester.umd.js @@ -231,8 +231,9 @@ } // Loop through hooks onInit(), - this.config.getValidHooks(this, 'onInit').forEach(function (hook) { - hook.onInit(_this); + var validHooks = this.config.getValidHooks(this, 'onInit'); + validHooks.forEach(function (hook) { + return hook.onInit(_this); }); } @@ -405,6 +406,7 @@ /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() { var mountOpts, + validHooks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, @@ -420,73 +422,72 @@ switch (_context4.prev = _context4.next) { case 0: mountOpts = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}; - // Loop through hooks onBeforeMount(), - // This MUST be a regular for () loop to not throw the promise away. (forEach won't work) + validHooks = this.config.getValidHooks(this, 'onBeforeMount'); _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; - _context4.prev = 4; - _iterator = this.config.getValidHooks(this, 'onBeforeMount')[Symbol.iterator](); + _context4.prev = 5; + _iterator = validHooks[Symbol.iterator](); - case 6: + case 7: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { - _context4.next = 13; + _context4.next = 14; break; } hook = _step.value; - _context4.next = 10; + _context4.next = 11; return hook.onBeforeMount(this, mountOpts); - case 10: + case 11: _iteratorNormalCompletion = true; - _context4.next = 6; + _context4.next = 7; break; - case 13: - _context4.next = 19; + case 14: + _context4.next = 20; break; - case 15: - _context4.prev = 15; - _context4.t0 = _context4["catch"](4); + case 16: + _context4.prev = 16; + _context4.t0 = _context4["catch"](5); _didIteratorError = true; _iteratorError = _context4.t0; - case 19: - _context4.prev = 19; + case 20: _context4.prev = 20; + _context4.prev = 21; if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } - case 22: - _context4.prev = 22; + case 23: + _context4.prev = 23; if (!_didIteratorError) { - _context4.next = 25; + _context4.next = 26; break; } throw _iteratorError; - case 25: - return _context4.finish(22); - case 26: - return _context4.finish(19); + return _context4.finish(23); case 27: + return _context4.finish(20); + + case 28: if (!this.onBeforeMount) { - _context4.next = 30; + _context4.next = 31; break; } - _context4.next = 30; + _context4.next = 31; return this.onBeforeMount(this); - case 30: + case 31: initialMount = this.initialMount || React__default.createElement(this.TestedComponent, this.props); WrapperTree = this.getWrappers().reduce(function (Tree, wrapper) { var wrapperChildren = wrapper.renderChildren !== false && Tree; @@ -497,10 +498,10 @@ return Tree; }, initialMount); - _context4.next = 34; + _context4.next = 35; return this.config.enzyme.mount(WrapperTree); - case 34: + case 35: this.wrapper = _context4.sent; if (this.opts.shallow) { @@ -508,25 +509,25 @@ } if (!mountOpts.async) { - _context4.next = 40; + _context4.next = 41; break; } - _context4.next = 39; + _context4.next = 40; return this.sleep(); - case 39: + case 40: this.update(); - case 40: + case 41: return _context4.abrupt("return", this); - case 41: + case 42: case "end": return _context4.stop(); } } - }, _callee4, this, [[4, 15, 19, 27], [20,, 22, 26]]); + }, _callee4, this, [[5, 16, 20, 28], [21,, 23, 27]]); })); function mount() { diff --git a/dist/tester.umd.js.map b/dist/tester.umd.js.map index 5f58e8c..d9a5c44 100644 --- a/dist/tester.umd.js.map +++ b/dist/tester.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"tester.umd.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n this.config.getValidHooks(this, 'onInit').forEach((hook: IHook) => {\n hook.onInit(this);\n });\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n for (const hook of this.config.getValidHooks(this, 'onBeforeMount')) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["React","Fragment","_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;AACA,EAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACvC,EAAE,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACtC,EAAE,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;EAC9C,CAAC;AACD,EAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;EACxC,EAAE,OAAO,OAAO,KAAK,KAAK,UAA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AC;EACxB,SAAS;;EAET,QAAQ,IAAI,KAAK,EAAE;EACnB,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC3B,SAAS;EACT,OAAO,CAAC,CAAC;EACT,MAAM,OAAO,KAAK,CAAC;EACnB,KAAK;EACL,GAAG,CAAC,CAAC,CAAC;;EAEN,EAAE,OAAO,kBAAkB,CAAC;EAC5B,CAAC,EAAE,CAAC;;AC/ID,MAAC,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"tester.umd.js","sources":["../src/utils.ts","../src/tester.tsx","../src/ConfigurationClass.ts","../src/index.ts"],"sourcesContent":["/*\n Utilities\n*/\n\nexport function getInstance (component: any) {\n const instance = component.instance();\n return instance.wrappedInstance || instance;\n}\n\nexport function getValue (tester: any, value: unknown) {\n return typeof value === 'function' ? value(tester) : value;\n}\n\nexport async function sleep (ms: number = 0) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function capitalize (string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function isString (value: unknown): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n","import React, { Fragment } from 'react';\n\nimport {\n getInstance,\n getValue,\n isString,\n sleep,\n} from './utils';\n\nimport ConfigurationClass from './ConfigurationClass';\nimport { IHook, IProfile, ITesterOpts, IWrapper, ComponentClass, IOnInit, IOnBeforeMount } from './interfaces';\n\ntype ISelectArg = string | { simulate: (event: string) => void };\n\nconst NullComponent: React.FC = (props: any) => ();\n\n/*\n Name: Tester\n Description: Testing utility class to mount a specific component with it's required wrappers.\n\n Usage:\n // Bootstrap Transport, localStorage + Session and an AppState.\n const tester = new Tester(MyComponent);\n\n // Bootstrap nothing, use with light components that doesn't need any of the above.\n const tester = new TesterLight(MyComponent);\n\n // Mount the component\n await tester.mount();\n\n // Test component that requires more JSX than the component only :\n const new Tester(MyComponent, {mount: (
)});\n\n // You can mount right away if no Transport or AppState modification is needed.\n const tester = await new Tester(MyComponent).mount();\n\n // opts.shallow is an experimental feature that allows you to test the TestedComponent instance behaviors.\n // Please only use it when necessary.\n const tester = await new Tester(MyComponent, { shallow: true }).mount();\n tester.shallow.wrapper // equals to shallow()\n tester.shallow.instance // equals to tester.shallow.instance()\n*/\n\n/**\n * Testing utility class to mount a specific component with it's required wrappers.\n */\nclass Tester {\n public static Configuration: ConfigurationClass;\n\n public opts: ITesterOpts;\n\n public config: ConfigurationClass;\n public initialMount: React.ReactNode;\n public onBeforeMount?: (tester: Tester) => Promise;\n public profile: IProfile;\n public props: object;\n public TestedComponent: ComponentClass;\n\n public AppState: any;\n public shallow: any;\n public wrapper: any;\n\n public constructor (TestedComponent: ComponentClass, opts: ITesterOpts = {}) {\n this.config = Tester.Configuration;\n this.initialMount = opts.mount;\n this.onBeforeMount = opts.onBeforeMount;\n this.opts = opts;\n this.profile = {...this.config.profiles.Default, ...opts.profile};\n this.props = opts.props || {};\n this.TestedComponent = TestedComponent;\n\n // Allow testing without a main TestedComponent. This require an initialMount.\n if (!this.TestedComponent && this.initialMount) {\n this.TestedComponent = NullComponent;\n this.initialMount = {this.initialMount};\n }\n\n // Loop through hooks onInit(),\n const validHooks = this.config.getValidHooks(this, 'onInit') as Array;\n validHooks.forEach(hook => hook.onInit(this));\n }\n\n public getWrappers (): IWrapper[] {\n const wrappers: IWrapper[] = [];\n\n this.config.getValidHooks(this, 'component').forEach((hook: IHook) => {\n wrappers.push({\n component: hook.component,\n name: hook.name,\n props: getValue(this, hook.props),\n });\n });\n\n return wrappers;\n }\n\n public get instance () {\n return getInstance(this.component);\n }\n\n public get component () {\n return this.wrapper.find(this.TestedComponent);\n }\n\n public debug () {\n // tslint:disable-next-line:no-console\n console.log(this.wrapper.debug());\n }\n\n public html () {\n return this.component.html();\n }\n\n public text () {\n return this.component.text();\n }\n\n public find (selector: string) {\n return this.wrapper.find(selector);\n }\n\n public update () {\n return this.wrapper.update();\n }\n\n public async sleep (ms?: number) {\n await sleep(ms);\n }\n\n public async refresh (ms?: number) {\n await sleep(ms);\n this.update();\n }\n\n private getComponent (selector: ISelectArg) {\n return isString(selector) ? this.find(selector).first() : selector;\n }\n\n public changeInput (selector: ISelectArg, value: string) {\n const component = this.getComponent(selector);\n component.simulate('focus');\n component.simulate('change', { target: { value } });\n component.simulate('blur');\n }\n\n public click (selector: ISelectArg) {\n const component = this.getComponent(selector);\n component.simulate('click');\n }\n\n public async submit (selector: ISelectArg = 'form') {\n const component = this.getComponent(selector);\n component.simulate('submit');\n await this.refresh();\n }\n\n public createShallowWrapper () {\n this.shallow = {};\n const WrappedComponent = (this.TestedComponent as any).wrappedComponent as ComponentClass;\n\n this.shallow.wrapper = this.config.enzyme.mount(\n ,\n );\n this.shallow.instance = getInstance(this.shallow.wrapper);\n }\n\n public async mount (mountOpts: { async?: boolean } = {}) {\n\n // Loop through hooks onBeforeMount(),\n // This MUST be a regular for () loop to not throw the promise away. (forEach won't work)\n type IValidHook = IHook & { onBeforeMount: IOnBeforeMount };\n const validHooks = this.config.getValidHooks(this, 'onBeforeMount') as IValidHook[];\n for (const hook of validHooks) {\n await hook.onBeforeMount(this, mountOpts);\n }\n\n // Allows you to fetch data to set as props, prepare extra stores, etc.\n if (this.onBeforeMount) {\n await this.onBeforeMount(this);\n }\n\n const initialMount = this.initialMount || ;\n\n const WrapperTree = this.getWrappers().reduce((Tree, wrapper) => {\n const wrapperChildren = wrapper.renderChildren !== false && Tree;\n if (wrapper.props) {\n return {wrapperChildren};\n }\n return Tree;\n }, initialMount);\n\n this.wrapper = await this.config.enzyme.mount(WrapperTree);\n\n if (this.opts.shallow) {\n this.createShallowWrapper();\n }\n\n if (mountOpts.async) {\n await this.sleep();\n this.update();\n }\n\n return this;\n }\n}\n\nexport default Tester;\n","import Tester from './tester';\nimport { capitalize } from './utils';\nimport { ComponentClass, IConfig, IHook, IProfile, ITesterClass } from './interfaces';\n\n/*\n Tester Configuration Class\n*/\nclass ConfigurationClass {\n public enzyme: any;\n public hooks: { [key: string]: IHook } = {};\n public profiles: { [key: string]: IProfile } = {\n // Default profile, each of it's properties can be overwritten.\n Default: {} as IProfile,\n };\n public Tester: ITesterClass;\n\n public constructor (argTester: ITesterClass) {\n this.Tester = argTester;\n argTester.Configuration = this;\n }\n\n public configure (enzyme: any, config: IConfig) {\n this.enzyme = enzyme;\n\n if (config.hooks) {\n config.hooks.forEach((hook: IHook) => {\n this.registerHook(hook);\n });\n }\n\n if (config.profiles) {\n config.profiles.forEach((profile) => {\n this.registerProfile(profile);\n });\n }\n\n this.createShortcuts();\n\n return this.Tester;\n }\n\n /*\n Create shortcuts for each global profiles\n Tester shortcuts allows you to use a specific global profile without having to pass it in in the options.\n\n E.g.\n Using a new Tester.Light(MyComponent) allows you to skip the initialization of\n Transport, localStorage + Session and AppState.\n */\n public createShortcuts () {\n Object.keys(this.profiles).forEach((profileKey) => {\n this.Tester[profileKey] = (TestedComponent: ComponentClass, opts = {}) =>\n new this.Tester(TestedComponent, {...opts, profile: this.profiles[profileKey]});\n });\n }\n\n /*\n Hooks,\n {\n name: string,\n component: React.Component,\n props: object || fn(), // fn() allows this.AppState to be set for e.g\n onInit: fn(),\n onBeforeMount: fn(),\n shortCuts: {shortCutName: fn()},\n wrapper: fn() => { Component: React.Component, name: string, props: object }\n }\n\n Note: Order is important!\n */\n public registerHook (hook: IHook) {\n if (!hook.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n if (this.hooks[hook.name]) {\n throw new Error(`Tester.registerHook() : A hook named \"${hook.name}\" already exist.`);\n }\n\n // Validate hook properties here.\n\n this.hooks[hook.name] = hook;\n }\n\n /*\n Profiles,\n {\n // Profile keys must be hook names.\n }\n */\n public registerProfile (profile: IProfile) {\n if (!profile.name) { throw new Error('Tester.registerHook() : A hooks must have a name.'); }\n\n const capitalizedName = capitalize(profile.name);\n\n if (this.profiles[capitalizedName] && capitalizedName !== 'Default') {\n throw new Error(`Tester.registerProfile() : A profile named \"${capitalizedName}\" already exist.`);\n }\n\n // Validate profile properties here.\n // - Does every key or the profile is a hook ?\n\n this.profiles[capitalizedName] = profile;\n }\n\n public getValidHooks (tester: Tester, hookProp: string): IHook[] {\n const hooks: IHook[] = [];\n\n Object.values(this.hooks).forEach((hook) => {\n let valid = true;\n if (!tester.profile[hook.name]) { valid = false; }\n if (hookProp && !hook[hookProp]) { valid = false; }\n\n if (valid) {\n hooks.push(hook);\n }\n });\n\n return hooks;\n }\n\n}\n\nexport default ConfigurationClass;\n","import Tester from './tester';\nimport ConfigurationClass from './ConfigurationClass';\n\nconst TesterConfig = new ConfigurationClass(Tester);\n\nexport {\n Tester,\n TesterConfig,\n};\n"],"names":["React","Fragment","_sleep","sleep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;AACA,EAAO,SAAS,WAAW,CAAC,SAAS,EAAE;EACvC,EAAE,IAAI,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;EACtC,EAAE,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC;EAC9C,CAAC;AACD,EAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;EACxC,EAAE,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7D,CAAC;AACD,EAAO,SAAS,KAAK,GAAG;EACxB,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;EACvC,CAAC;;EAED,SAAS,MAAM,GAAG;EAClB,EAAE,MAAM,GAAG,iBAAiB;EAC5B;EACA,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG;EAC7C,IAAI,IAAI,EAAE;EACV,QAAQ,KAAK,GAAG,SAAS,CAAC;EAC1B,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AC/ID,MAAC,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ff8f4b4..6fd12af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mighty-justice/tester", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index abaead9..882ea08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mighty-justice/tester", - "version": "1.2.2", + "version": "1.2.3", "description": "Bootstrap your tests!", "main": "dist/tester.cjs.js", "module": "dist/tester.esm.js",