UNPKG

rxjs-marbles-with-amd

Version:

Forked version of (https://github.com/cartant/rxjs-marbles) An RxJS marble testing library for any test framework

230 lines (193 loc) 44.1 kB
define("rxjs-marbles/undefined", ["rxjs","rxjs/testing"], function(__WEBPACK_EXTERNAL_MODULE_rxjs__, __WEBPACK_EXTERNAL_MODULE_rxjs_testing__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./source/index.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/fast-equals/dist/fast-equals.js": /*!******************************************************!*\ !*** ./node_modules/fast-equals/dist/fast-equals.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function (global, factory) {\n true ? factory(exports) :\n undefined;\n}(this, function (exports) { 'use strict';\n\n var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';\r\n var keys = Object.keys;\r\n /**\r\n * @function addToCache\r\n *\r\n * add object to cache if an object\r\n *\r\n * @param value the value to potentially add to cache\r\n * @param cache the cache to add to\r\n */\r\n function addToCache(value, cache) {\r\n if (value && typeof value === 'object') {\r\n cache.add(value);\r\n }\r\n }\r\n /**\r\n * @function hasPair\r\n *\r\n * @description\r\n * does the `pairToMatch` exist in the list of `pairs` provided based on the\r\n * `isEqual` check\r\n *\r\n * @param pairs the pairs to compare against\r\n * @param pairToMatch the pair to match\r\n * @param isEqual the equality comparator used\r\n * @param meta the meta provided\r\n * @returns does the pair exist in the pairs provided\r\n */\r\n function hasPair(pairs, pairToMatch, isEqual, meta) {\r\n var length = pairs.length;\r\n var pair;\r\n for (var index = 0; index < length; index++) {\r\n pair = pairs[index];\r\n if (isEqual(pair[0], pairToMatch[0], meta) &&\r\n isEqual(pair[1], pairToMatch[1], meta)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * @function hasValue\r\n *\r\n * @description\r\n * does the `valueToMatch` exist in the list of `values` provided based on the\r\n * `isEqual` check\r\n *\r\n * @param values the values to compare against\r\n * @param valueToMatch the value to match\r\n * @param isEqual the equality comparator used\r\n * @param meta the meta provided\r\n * @returns does the value exist in the values provided\r\n */\r\n function hasValue(values, valueToMatch, isEqual, meta) {\r\n var length = values.length;\r\n for (var index = 0; index < length; index++) {\r\n if (isEqual(values[index], valueToMatch, meta)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * @function sameValueZeroEqual\r\n *\r\n * @description\r\n * are the values passed strictly equal or both NaN\r\n *\r\n * @param a the value to compare against\r\n * @param b the value to test\r\n * @returns are the values equal by the SameValueZero principle\r\n */\r\n function sameValueZeroEqual(a, b) {\r\n return a === b || (a !== a && b !== b);\r\n }\r\n /**\r\n * @function isPlainObject\r\n *\r\n * @description\r\n * is the value a plain object\r\n *\r\n * @param value the value to test\r\n * @returns is the value a plain object\r\n */\r\n function isPlainObject(value) {\r\n return value.constructor === Object || value.constructor == null;\r\n }\r\n /**\r\n * @function isPromiseLike\r\n *\r\n * @description\r\n * is the value promise-like (meaning it is thenable)\r\n *\r\n * @param value the value to test\r\n * @returns is the value promise-like\r\n */\r\n function isPromiseLike(value) {\r\n return !!value && typeof value.then === 'function';\r\n }\r\n /**\r\n * @function isReactElement\r\n *\r\n * @description\r\n * is the value passed a react element\r\n *\r\n * @param value the value to test\r\n * @returns is the value a react element\r\n */\r\n function isReactElement(value) {\r\n return !!(value && value.$$typeof);\r\n }\r\n /**\r\n * @function getNewCacheFallback\r\n *\r\n * @description\r\n * in cases where WeakSet is not supported, creates a new custom\r\n * object that mimics the necessary API aspects for cache purposes\r\n *\r\n * @returns the new cache object\r\n */\r\n function getNewCacheFallback() {\r\n return Object.create({\r\n _values: [],\r\n add: function (value) {\r\n this._values.push(value);\r\n },\r\n has: function (value) {\r\n return this._values.indexOf(value) !== -1;\r\n },\r\n });\r\n }\r\n /**\r\n * @function getNewCache\r\n *\r\n * @description\r\n * get a new cache object to prevent circular references\r\n *\r\n * @returns the new cache object\r\n */\r\n var getNewCache = (function (canUseWeakMap) {\r\n if (canUseWeakMap) {\r\n return function _getNewCache() {\r\n return new WeakSet();\r\n };\r\n }\r\n return getNewCacheFallback;\r\n })(HAS_WEAKSET_SUPPORT);\r\n /**\r\n * @function createCircularEqualCreator\r\n *\r\n * @description\r\n * create a custom isEqual handler specific to circular objects\r\n *\r\n * @param [isEqual] the isEqual comparator to use instead of isDeepEqual\r\n * @returns the method to create the `isEqual` function\r\n */\r\n function createCircularEqualCreator(isEqual) {\r\n return function createCircularEqual(comparator) {\r\n var _comparator = isEqual || comparator;\r\n return function circularEqual(a, b, cache) {\r\n if (cache === void 0) { cache = getNewCache(); }\r\n var hasA = cache.has(a);\r\n var hasB = cache.has(b);\r\n if (hasA || hasB) {\r\n return hasA && hasB;\r\n }\r\n addToCache(a, cache);\r\n addToCache(b, cache);\r\n return _comparator(a, b, cache);\r\n };\r\n };\r\n }\r\n /**\r\n * @function toPairs\r\n *\r\n * @description\r\n * convert the map passed into pairs (meaning an array of [key, value] tuples)\r\n *\r\n * @param map the map to convert to [key, value] pairs (entries)\r\n * @returns the [key, value] pairs\r\n */\r\n function toPairs(map) {\r\n var pairs = new Array(map.size);\r\n var index = 0;\r\n map.forEach(function (value, key) {\r\n pairs[index++] = [key, value];\r\n });\r\n return pairs;\r\n }\r\n /**\r\n * @function toValues\r\n *\r\n * @description\r\n * convert the set passed into values\r\n *\r\n * @param set the set to convert to values\r\n * @returns the values\r\n */\r\n function toValues(set) {\r\n var values = new Array(set.size);\r\n var index = 0;\r\n set.forEach(function (value) {\r\n values[index++] = value;\r\n });\r\n return values;\r\n }\r\n /**\r\n * @function areArraysEqual\r\n *\r\n * @description\r\n * are the arrays equal in value\r\n *\r\n * @param a the array to test\r\n * @param b the array to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta object to pass through\r\n * @returns are the arrays equal\r\n */\r\n function areArraysEqual(a, b, isEqual, meta) {\r\n var length = a.length;\r\n if (b.length !== length) {\r\n return false;\r\n }\r\n for (var index = 0; index < length; index++) {\r\n if (!isEqual(a[index], b[index], meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * @function areMapsEqual\r\n *\r\n * @description\r\n * are the maps equal in value\r\n *\r\n * @param a the map to test\r\n * @param b the map to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta map to pass through\r\n * @returns are the maps equal\r\n */\r\n function areMapsEqual(a, b, isEqual, meta) {\r\n if (a.size !== b.size) {\r\n return false;\r\n }\r\n var pairsA = toPairs(a);\r\n var pairsB = toPairs(b);\r\n var length = pairsA.length;\r\n for (var index = 0; index < length; index++) {\r\n if (!hasPair(pairsB, pairsA[index], isEqual, meta) ||\r\n !hasPair(pairsA, pairsB[index], isEqual, meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n var OWNER = '_owner';\r\n var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);\r\n /**\r\n * @function areObjectsEqual\r\n *\r\n * @description\r\n * are the objects equal in value\r\n *\r\n * @param a the object to test\r\n * @param b the object to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta object to pass through\r\n * @returns are the objects equal\r\n */\r\n function areObjectsEqual(a, b, isEqual, meta) {\r\n var keysA = keys(a);\r\n var length = keysA.length;\r\n if (keys(b).length !== length) {\r\n return false;\r\n }\r\n var key;\r\n for (var index = 0; index < length; index++) {\r\n key = keysA[index];\r\n if (!hasOwnProperty(b, key)) {\r\n return false;\r\n }\r\n if (key === OWNER && isReactElement(a)) {\r\n if (!isReactElement(b)) {\r\n return false;\r\n }\r\n }\r\n else if (!isEqual(a[key], b[key], meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * @function areRegExpsEqual\r\n *\r\n * @description\r\n * are the regExps equal in value\r\n *\r\n * @param a the regExp to test\r\n * @param b the regExp to test agains\r\n * @returns are the regExps equal\r\n */\r\n function areRegExpsEqual(a, b) {\r\n return (a.source === b.source &&\r\n a.global === b.global &&\r\n a.ignoreCase === b.ignoreCase &&\r\n a.multiline === b.multiline &&\r\n a.unicode === b.unicode &&\r\n a.sticky === b.sticky &&\r\n a.lastIndex === b.lastIndex);\r\n }\r\n /**\r\n * @function areSetsEqual\r\n *\r\n * @description\r\n * are the sets equal in value\r\n *\r\n * @param a the set to test\r\n * @param b the set to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta set to pass through\r\n * @returns are the sets equal\r\n */\r\n function areSetsEqual(a, b, isEqual, meta) {\r\n if (a.size !== b.size) {\r\n return false;\r\n }\r\n var valuesA = toValues(a);\r\n var valuesB = toValues(b);\r\n var length = valuesA.length;\r\n for (var index = 0; index < length; index++) {\r\n if (!hasValue(valuesB, valuesA[index], isEqual, meta) ||\r\n !hasValue(valuesA, valuesB[index], isEqual, meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\n\n var isArray = Array.isArray;\r\n var HAS_MAP_SUPPORT = typeof Map === 'function';\r\n var HAS_SET_SUPPORT = typeof Set === 'function';\r\n var OBJECT_TYPEOF = 'object';\r\n function createComparator(createIsEqual) {\r\n var isEqual = \r\n /* eslint-disable no-use-before-define */\r\n typeof createIsEqual === 'function'\r\n ? createIsEqual(comparator)\r\n : comparator;\r\n /* eslint-enable */\r\n /**\r\n * @function comparator\r\n *\r\n * @description\r\n * compare the value of the two objects and return true if they are equivalent in values\r\n *\r\n * @param a the value to test against\r\n * @param b the value to test\r\n * @param [meta] an optional meta object that is passed through to all equality test calls\r\n * @returns are a and b equivalent in value\r\n */\r\n function comparator(a, b, meta) {\r\n if (sameValueZeroEqual(a, b)) {\r\n return true;\r\n }\r\n if (a && b && typeof a === OBJECT_TYPEOF && typeof b === OBJECT_TYPEOF) {\r\n if (isPlainObject(a) && isPlainObject(b)) {\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n var arrayA = isArray(a);\r\n var arrayB = isArray(b);\r\n if (arrayA || arrayB) {\r\n return arrayA === arrayB && areArraysEqual(a, b, isEqual, meta);\r\n }\r\n var aDate = a instanceof Date;\r\n var bDate = b instanceof Date;\r\n if (aDate || bDate) {\r\n return aDate === bDate && sameValueZeroEqual(a.getTime(), b.getTime());\r\n }\r\n var aRegExp = a instanceof RegExp;\r\n var bRegExp = b instanceof RegExp;\r\n if (aRegExp || bRegExp) {\r\n return aRegExp === bRegExp && areRegExpsEqual(a, b);\r\n }\r\n if (isPromiseLike(a) || isPromiseLike(b)) {\r\n return a === b;\r\n }\r\n if (HAS_MAP_SUPPORT) {\r\n var aMap = a instanceof Map;\r\n var bMap = b instanceof Map;\r\n if (aMap || bMap) {\r\n return aMap === bMap && areMapsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n if (HAS_SET_SUPPORT) {\r\n var aSet = a instanceof Set;\r\n var bSet = b instanceof Set;\r\n if (aSet || bSet) {\r\n return aSet === bSet && areSetsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n return false;\r\n }\r\n return comparator;\r\n }\n\n // comparator\r\n var deepEqual = createComparator();\r\n var shallowEqual = createComparator(function () { return sameValueZeroEqual; });\r\n var circularDeepEqual = createComparator(createCircularEqualCreator());\r\n var circularShallowEqual = createComparator(createCircularEqualCreator(sameValueZeroEqual));\n\n exports.circularDeepEqual = circularDeepEqual;\n exports.circularShallowEqual = circularShallowEqual;\n exports.createCustomEqual = createComparator;\n exports.deepEqual = deepEqual;\n exports.sameValueZeroEqual = sameValueZeroEqual;\n exports.shallowEqual = shallowEqual;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=fast-equals.js.map\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./node_modules/fast-equals/dist/fast-equals.js?"); /***/ }), /***/ "./source/args.ts": /*!************************!*\ !*** ./source/args.ts ***! \************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.argsSymbol = Symbol(\"args\");\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/args.ts?"); /***/ }), /***/ "./source/assert.ts": /*!**************************!*\ !*** ./source/assert.ts ***! \**************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar args_1 = __webpack_require__(/*! ./args */ \"./source/args.ts\");\nfunction assertArgs(observable) {\n if (!observable[args_1.argsSymbol]) {\n throw new Error(\"Expected a hot or cold test observable.\");\n }\n}\nexports.assertArgs = assertArgs;\nfunction assertSubscriptions(observable) {\n if (!observable[\"subscriptions\"]) {\n throw new Error(\"Expected a hot or cold test observable with subscriptions.\");\n }\n}\nexports.assertSubscriptions = assertSubscriptions;\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/assert.ts?"); /***/ }), /***/ "./source/configuration.ts": /*!*********************************!*\ !*** ./source/configuration.ts ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fast_equals_1 = __webpack_require__(/*! fast-equals */ \"./node_modules/fast-equals/dist/fast-equals.js\");\nvar defaultConfiguration = {\n assert: defaultAssert,\n assertDeepEqual: defaultAssertDeepEqual,\n frameworkMatcher: false,\n run: true\n};\nfunction defaults() {\n return __assign({}, defaultConfiguration);\n}\nexports.defaults = defaults;\nfunction defaultAssert(value, message) {\n if (value) {\n return;\n }\n throw new Error(message);\n}\nfunction defaultAssertDeepEqual(a, b) {\n if (fast_equals_1.circularDeepEqual(a, b)) {\n return;\n }\n throw new Error(\"Expected \" + toString(a) + \" to equal \" + toString(b) + \".\");\n}\nfunction toString(value) {\n if (value === null) {\n return \"null\";\n }\n else if (value === undefined) {\n return \"undefined\";\n }\n return value.toString();\n}\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/configuration.ts?"); /***/ }), /***/ "./source/context-deprecated.ts": /*!**************************************!*\ !*** ./source/context-deprecated.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"rxjs\");\nvar testing_1 = __webpack_require__(/*! rxjs/testing */ \"rxjs/testing\");\nvar args_1 = __webpack_require__(/*! ./args */ \"./source/args.ts\");\nvar assert_1 = __webpack_require__(/*! ./assert */ \"./source/assert.ts\");\nvar expect_1 = __webpack_require__(/*! ./expect */ \"./source/expect.ts\");\nvar matcher_1 = __webpack_require__(/*! ./matcher */ \"./source/matcher.ts\");\nvar DeprecatedContext = (function () {\n function DeprecatedContext(configuration_) {\n this.configuration_ = configuration_;\n this.autoFlush = true;\n this.bindings_ = [];\n this.frameTimeFactor_ = undefined;\n this.reframable_ = true;\n }\n Object.defineProperty(DeprecatedContext.prototype, \"scheduler\", {\n get: function () {\n var _this = this;\n if (!this.scheduler_) {\n this.scheduler_ = new testing_1.TestScheduler(function (actual, expected) {\n return matcher_1.observableMatcher(actual, expected, _this.configuration_.assert, _this.configuration_.assertDeepEqual, _this.configuration_.frameworkMatcher);\n });\n }\n return this.scheduler_;\n },\n enumerable: true,\n configurable: true\n });\n DeprecatedContext.prototype.bind = function () {\n var _this = this;\n var schedulers = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n schedulers[_i] = arguments[_i];\n }\n if (this.bindings_.length !== 0) {\n throw new Error(\"Schedulers already bound.\");\n }\n if (schedulers.length === 0) {\n schedulers = [\n rxjs_1.animationFrameScheduler,\n rxjs_1.asapScheduler,\n rxjs_1.asyncScheduler,\n rxjs_1.queueScheduler\n ];\n }\n this.bindings_ = schedulers.map(function (instance) {\n var now = instance.hasOwnProperty(\"now\") ? instance.now : undefined;\n instance.now = function () { return _this.scheduler.now(); };\n var schedule = instance.hasOwnProperty(\"schedule\")\n ? instance.schedule\n : undefined;\n instance.schedule = function (work, delay, state) {\n return _this.scheduler.schedule(work, delay, state);\n };\n return { instance: instance, now: now, schedule: schedule };\n });\n };\n DeprecatedContext.prototype.cold = function (marbles, values, error) {\n var scheduler = this.scheduler;\n this.reframable_ = false;\n var observable = scheduler.createColdObservable(marbles, values, error);\n observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values };\n return observable;\n };\n DeprecatedContext.prototype.configure = function (configuration) {\n if (this.scheduler_) {\n throw new Error(\"Scheduler already created; call configure before using other context methods and properties.\");\n }\n this.configuration_ = __assign(__assign({}, this.configuration_), configuration);\n };\n DeprecatedContext.prototype.equal = function (actual) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var scheduler = this.scheduler;\n var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3];\n if (a1 && typeof a1 === \"string\") {\n scheduler.expectObservable(actual, a0).toBe(a1, a2, a3);\n }\n else if (a1 && a1[args_1.argsSymbol]) {\n assert_1.assertArgs(a1);\n var _a = a1[args_1.argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values;\n scheduler.expectObservable(actual, a0).toBe(marbles, values, error);\n }\n else if (typeof a0 === \"string\") {\n scheduler.expectObservable(actual).toBe(a0, a1, a2);\n }\n else {\n assert_1.assertArgs(a0);\n var _b = a0[args_1.argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values;\n scheduler.expectObservable(actual).toBe(marbles, values, error);\n }\n };\n DeprecatedContext.prototype.expect = function (actual, subscription) {\n var scheduler = this.scheduler;\n return new expect_1.Expect(actual, scheduler, subscription);\n };\n DeprecatedContext.prototype.flush = function () {\n var scheduler = this.scheduler;\n this.reframable_ = false;\n scheduler.flush();\n };\n DeprecatedContext.prototype.has = function (actual, expected) {\n assert_1.assertSubscriptions(actual);\n var scheduler = this.scheduler;\n scheduler.expectSubscriptions(actual.subscriptions).toBe(expected);\n };\n DeprecatedContext.prototype.hot = function (marbles, values, error) {\n var scheduler = this.scheduler;\n this.reframable_ = false;\n var observable = scheduler.createHotObservable(marbles, values, error);\n observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values };\n return observable;\n };\n DeprecatedContext.prototype.reframe = function (timePerFrame, maxTime) {\n if (!this.reframable_) {\n throw new Error(\"Cannot reframe; scheduler already used.\");\n }\n if (maxTime === undefined) {\n maxTime = timePerFrame * 75;\n }\n this.frameTimeFactor_ =\n rxjs_1.VirtualTimeScheduler.frameTimeFactor ||\n testing_1.TestScheduler.frameTimeFactor;\n rxjs_1.VirtualTimeScheduler.frameTimeFactor = timePerFrame;\n testing_1.TestScheduler.frameTimeFactor = timePerFrame;\n var scheduler = this.scheduler;\n scheduler.maxFrames = maxTime;\n };\n DeprecatedContext.prototype.teardown = function () {\n try {\n if (this.autoFlush) {\n this.scheduler.flush();\n }\n }\n finally {\n this.bindings_.forEach(function (_a) {\n var instance = _a.instance, now = _a.now, schedule = _a.schedule;\n if (now) {\n instance.now = now;\n }\n else {\n delete instance.now;\n }\n if (schedule) {\n instance.schedule = schedule;\n }\n else {\n delete instance.schedule;\n }\n });\n if (this.frameTimeFactor_) {\n rxjs_1.VirtualTimeScheduler.frameTimeFactor = this.frameTimeFactor_;\n testing_1.TestScheduler.frameTimeFactor = this.frameTimeFactor_;\n }\n }\n };\n DeprecatedContext.prototype.time = function (marbles) {\n var scheduler = this.scheduler;\n this.reframable_ = false;\n return scheduler.createTime(marbles);\n };\n return DeprecatedContext;\n}());\nexports.DeprecatedContext = DeprecatedContext;\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/context-deprecated.ts?"); /***/ }), /***/ "./source/context-run.ts": /*!*******************************!*\ !*** ./source/context-run.ts ***! \*******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar testing_1 = __webpack_require__(/*! rxjs/testing */ \"rxjs/testing\");\nvar args_1 = __webpack_require__(/*! ./args */ \"./source/args.ts\");\nvar assert_1 = __webpack_require__(/*! ./assert */ \"./source/assert.ts\");\nvar expect_1 = __webpack_require__(/*! ./expect */ \"./source/expect.ts\");\nvar RunContext = (function () {\n function RunContext(scheduler, helpers_) {\n this.scheduler = scheduler;\n this.helpers_ = helpers_;\n }\n Object.defineProperty(RunContext.prototype, \"autoFlush\", {\n get: function () {\n throw notSupported(\"autoFlush\");\n },\n set: function (value) {\n throw notSupported(\"autoFlush\");\n },\n enumerable: true,\n configurable: true\n });\n RunContext.prototype.bind = function () {\n var schedulers = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n schedulers[_i] = arguments[_i];\n }\n throw notSupported(\"bind\");\n };\n RunContext.prototype.cold = function (marbles, values, error) {\n var helpers_ = this.helpers_;\n var observable = helpers_.cold(marbles, values, error);\n observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values };\n return observable;\n };\n RunContext.prototype.configure = function (configuration) {\n throw notSupported(\"configure\");\n };\n RunContext.prototype.equal = function (actual) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var helpers_ = this.helpers_;\n var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3];\n if (a1 && typeof a1 === \"string\") {\n helpers_.expectObservable(actual, a0).toBe(a1, a2, a3);\n }\n else if (a1 && a1[args_1.argsSymbol]) {\n assert_1.assertArgs(a1);\n var _a = a1[args_1.argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values;\n helpers_.expectObservable(actual, a0).toBe(marbles, values, error);\n }\n else if (typeof a0 === \"string\") {\n helpers_.expectObservable(actual).toBe(a0, a1, a2);\n }\n else {\n assert_1.assertArgs(a0);\n var _b = a0[args_1.argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values;\n helpers_.expectObservable(actual).toBe(marbles, values, error);\n }\n };\n RunContext.prototype.expect = function (actual, subscription) {\n var helpers_ = this.helpers_;\n return new expect_1.Expect(actual, helpers_, subscription);\n };\n RunContext.prototype.flush = function () {\n this.helpers_.flush();\n };\n RunContext.prototype.has = function (actual, expected) {\n assert_1.assertSubscriptions(actual);\n var helpers_ = this.helpers_;\n helpers_.expectSubscriptions(actual.subscriptions).toBe(expected);\n };\n RunContext.prototype.hot = function (marbles, values, error) {\n var helpers_ = this.helpers_;\n var observable = helpers_.hot(marbles, values, error);\n observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values };\n return observable;\n };\n RunContext.prototype.reframe = function (timePerFrame, maxTime) {\n throw notSupported(\"reframe\");\n };\n RunContext.prototype.teardown = function () {\n throw notSupported(\"teardown\");\n };\n RunContext.prototype.time = function (marbles) {\n var messages = testing_1.TestScheduler.parseMarbles(marbles, undefined, undefined, undefined, true);\n var complete = messages.find(function (_a) {\n var notification = _a.notification;\n return notification.kind === \"C\";\n });\n if (complete) {\n return complete.frame;\n }\n return this.scheduler.createTime(marbles);\n };\n return RunContext;\n}());\nexports.RunContext = RunContext;\nfunction notSupported(name) {\n return new Error(name + \" is not supported when using the latest TestScheduler. For the deprecated behaviour, use 'const { marbles } = configure({ run: false })'.\");\n}\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/context-run.ts?"); /***/ }), /***/ "./source/expect.ts": /*!**************************!*\ !*** ./source/expect.ts ***! \**************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar args_1 = __webpack_require__(/*! ./args */ \"./source/args.ts\");\nvar assert_1 = __webpack_require__(/*! ./assert */ \"./source/assert.ts\");\nvar Expect = (function () {\n function Expect(actual, helpers, subscription) {\n this.actual = actual;\n this.helpers = helpers;\n this.subscription = subscription;\n }\n Expect.prototype.toBeObservable = function (expected, values, error) {\n var _a = this, actual = _a.actual, helpers = _a.helpers, subscription = _a.subscription;\n if (typeof expected === \"string\") {\n helpers\n .expectObservable(actual, subscription)\n .toBe(expected, values, error);\n }\n else {\n assert_1.assertArgs(expected);\n var _b = expected[args_1.argsSymbol], error_1 = _b.error, marbles = _b.marbles, values_1 = _b.values;\n helpers\n .expectObservable(actual, subscription)\n .toBe(marbles, values_1, error_1);\n }\n };\n Expect.prototype.toHaveSubscriptions = function (expected) {\n var _a = this, actual = _a.actual, helpers = _a.helpers;\n assert_1.assertSubscriptions(actual);\n var subscriptions = actual.subscriptions;\n helpers.expectSubscriptions(subscriptions).toBe(expected);\n };\n return Expect;\n}());\nexports.Expect = Expect;\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/expect.ts?"); /***/ }), /***/ "./source/index.ts": /*!*************************!*\ !*** ./source/index.ts ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(__webpack_require__(/*! ./configuration */ \"./source/configuration.ts\"));\n__export(__webpack_require__(/*! ./expect */ \"./source/expect.ts\"));\n__export(__webpack_require__(/*! ./marbles */ \"./source/marbles.ts\"));\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/index.ts?"); /***/ }), /***/ "./source/marbles.ts": /*!***************************!*\ !*** ./source/marbles.ts ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar testing_1 = __webpack_require__(/*! rxjs/testing */ \"rxjs/testing\");\nvar configuration_1 = __webpack_require__(/*! ./configuration */ \"./source/configuration.ts\");\nvar context_deprecated_1 = __webpack_require__(/*! ./context-deprecated */ \"./source/context-deprecated.ts\");\nvar context_run_1 = __webpack_require__(/*! ./context-run */ \"./source/context-run.ts\");\nvar matcher_1 = __webpack_require__(/*! ./matcher */ \"./source/matcher.ts\");\nfunction configure(configurationOrFactory) {\n function deriveConfiguration() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var explicit = typeof configurationOrFactory === \"function\"\n ? configurationOrFactory.apply(void 0, args) : configurationOrFactory;\n return __assign(__assign({}, configuration_1.defaults()), explicit);\n }\n function _marbles(func) {\n var wrapper = function () {\n var _this = this;\n var rest = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n rest[_i] = arguments[_i];\n }\n var configuration = deriveConfiguration.apply(void 0, rest);\n if (configuration.run) {\n var scheduler_1 = new testing_1.TestScheduler(function (actual, expected) {\n return matcher_1.observableMatcher(actual, expected, configuration.assert, configuration.assertDeepEqual, configuration.frameworkMatcher);\n });\n return scheduler_1.run(function (helpers) {\n return func.call.apply(func, __spreadArrays([_this, new context_run_1.RunContext(scheduler_1, helpers)], rest));\n });\n }\n var context = new context_deprecated_1.DeprecatedContext(configuration);\n try {\n return func.call.apply(func, __spreadArrays([this, context], rest));\n }\n finally {\n context.teardown();\n }\n };\n if (func.length > 1) {\n return function (first) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n return wrapper.apply(void 0, __spreadArrays([first], rest));\n };\n }\n return wrapper;\n }\n return { marbles: _marbles };\n}\nexports.configure = configure;\nexports.marbles = configure(configuration_1.defaults()).marbles;\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/marbles.ts?"); /***/ }), /***/ "./source/matcher.ts": /*!***************************!*\ !*** ./source/matcher.ts ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fast_equals_1 = __webpack_require__(/*! fast-equals */ \"./node_modules/fast-equals/dist/fast-equals.js\");\nfunction stringify(x) {\n if (x === undefined) {\n return \"undefined\";\n }\n return JSON.stringify(x, function (key, value) {\n if (Array.isArray(value)) {\n return (\"[\" +\n value.map(function (i) {\n return \"\\n\\t\" + stringify(i);\n }) +\n \"\\n]\");\n }\n return value;\n })\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\t/g, \"\\t\")\n .replace(/\\\\n/g, \"\\n\");\n}\nfunction deleteErrorNotificationStack(marble) {\n var notification = marble.notification;\n if (notification) {\n var kind = notification.kind, error = notification.error;\n if (kind === \"E\" && error instanceof Error) {\n notification.error = { name: error.name, message: error.message };\n }\n }\n return marble;\n}\nfunction observableMatcher(actual, expected, assert, assertDeepEqual, frameworkMatcher) {\n if (Array.isArray(actual) && Array.isArray(expected)) {\n actual = actual.map(deleteErrorNotificationStack);\n expected = expected.map(deleteErrorNotificationStack);\n if (frameworkMatcher) {\n assertDeepEqual(actual, expected);\n }\n else {\n var passed = fast_equals_1.circularDeepEqual(actual, expected);\n if (passed) {\n assert(true, \"\");\n return;\n }\n var message_1 = \"\\nExpected \\n\";\n actual.forEach(function (x) { return (message_1 += \"\\t\" + stringify(x) + \"\\n\"); });\n message_1 += \"\\t\\nto deep equal \\n\";\n expected.forEach(function (x) { return (message_1 += \"\\t\" + stringify(x) + \"\\n\"); });\n assert(passed, message_1);\n }\n }\n else {\n assertDeepEqual(actual, expected);\n }\n}\nexports.observableMatcher = observableMatcher;\n\n\n//# sourceURL=webpack://rxjs-marbles/undefined/./source/matcher.ts?"); /***/ }), /***/ "rxjs": /*!************************************************************************************!*\ !*** external {"root":["rxjs"],"commonjs":"rxjs","commonjs2":"rxjs","amd":"rxjs"} ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = __WEBPACK_EXTERNAL_MODULE_rxjs__;\n\n//# sourceURL=webpack://rxjs-marbles/undefined/external_%7B%22root%22:%5B%22rxjs%22%5D,%22commonjs%22:%22rxjs%22,%22commonjs2%22:%22rxjs%22,%22amd%22:%22rxjs%22%7D?"); /***/ }), /***/ "rxjs/testing": /*!**********************************************************************************************************************!*\ !*** external {"root":["rxjs","testing"],"commonjs":"rxjs/testing","commonjs2":"rxjs/testing","amd":"rxjs/testing"} ***! \**********************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = __WEBPACK_EXTERNAL_MODULE_rxjs_testing__;\n\n//# sourceURL=webpack://rxjs-marbles/undefined/external_%7B%22root%22:%5B%22rxjs%22,%22testing%22%5D,%22commonjs%22:%22rxjs/testing%22,%22commonjs2%22:%22rxjs/testing%22,%22amd%22:%22rxjs/testing%22%7D?"); /***/ }) /******/ })});;