relay-test-utils-internal 18.0.0 → 18.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +1 -1
- package/index.js.flow +3 -1
- package/injectPromisePolyfill__DEPRECATED.js.flow +33 -0
- package/lib/index.js +3 -1
- package/lib/injectPromisePolyfill__DEPRECATED.js +13 -0
- package/package.json +2 -2
- package/relay-test-utils-internal.js +2 -2
- package/relay-test-utils-internal.min.js +2 -2
package/index.js
CHANGED
package/index.js.flow
CHANGED
@@ -28,6 +28,7 @@ const {
|
|
28
28
|
FIXTURE_TAG,
|
29
29
|
generateTestsFromFixtures,
|
30
30
|
} = require('./generateTestsFromFixtures');
|
31
|
+
const injectPromisePolyfill__DEPRECATED = require('./injectPromisePolyfill__DEPRECATED');
|
31
32
|
const Matchers = require('./Matchers');
|
32
33
|
const printAST = require('./printAST');
|
33
34
|
const simpleClone = require('./simpleClone');
|
@@ -77,14 +78,15 @@ module.exports = {
|
|
77
78
|
expectConsoleError,
|
78
79
|
expectConsoleErrorsMany,
|
79
80
|
expectConsoleErrorWillFire,
|
80
|
-
expectConsoleWarningWillFire,
|
81
81
|
expectConsoleWarning,
|
82
82
|
expectConsoleWarningsMany,
|
83
|
+
expectConsoleWarningWillFire,
|
83
84
|
expectToWarn,
|
84
85
|
expectToWarnMany,
|
85
86
|
expectWarningWillFire,
|
86
87
|
FIXTURE_TAG,
|
87
88
|
generateTestsFromFixtures,
|
89
|
+
injectPromisePolyfill__DEPRECATED,
|
88
90
|
matchers: Matchers,
|
89
91
|
printAST,
|
90
92
|
simpleClone,
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*
|
7
|
+
* @format
|
8
|
+
* @oncall relay
|
9
|
+
*/
|
10
|
+
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Provides backwards compatability for unit tests relying on promise-polyfill
|
15
|
+
*
|
16
|
+
* Polyfill implementations and native promises have subtle differences in scheduling
|
17
|
+
* which can break async tests.
|
18
|
+
*
|
19
|
+
* This should be removed once all tests have been migrated off of ReactTestRenderer and polyfilled promises.
|
20
|
+
*/
|
21
|
+
function injectPromisePolyfill_DEPRECATED() {
|
22
|
+
let originalPromise;
|
23
|
+
beforeAll(() => {
|
24
|
+
originalPromise = global.Promise;
|
25
|
+
global.Promise = require('promise-polyfill');
|
26
|
+
});
|
27
|
+
|
28
|
+
afterAll(() => {
|
29
|
+
global.Promise = originalPromise;
|
30
|
+
});
|
31
|
+
}
|
32
|
+
|
33
|
+
module.exports = injectPromisePolyfill_DEPRECATED;
|
package/lib/index.js
CHANGED
@@ -14,6 +14,7 @@ var describeWithFeatureFlags = require('./describeWithFeatureFlags');
|
|
14
14
|
var _require3 = require('./generateTestsFromFixtures'),
|
15
15
|
FIXTURE_TAG = _require3.FIXTURE_TAG,
|
16
16
|
generateTestsFromFixtures = _require3.generateTestsFromFixtures;
|
17
|
+
var injectPromisePolyfill__DEPRECATED = require('./injectPromisePolyfill__DEPRECATED');
|
17
18
|
var Matchers = require('./Matchers');
|
18
19
|
var printAST = require('./printAST');
|
19
20
|
var simpleClone = require('./simpleClone');
|
@@ -53,14 +54,15 @@ module.exports = {
|
|
53
54
|
expectConsoleError: expectConsoleError,
|
54
55
|
expectConsoleErrorsMany: expectConsoleErrorsMany,
|
55
56
|
expectConsoleErrorWillFire: expectConsoleErrorWillFire,
|
56
|
-
expectConsoleWarningWillFire: expectConsoleWarningWillFire,
|
57
57
|
expectConsoleWarning: expectConsoleWarning,
|
58
58
|
expectConsoleWarningsMany: expectConsoleWarningsMany,
|
59
|
+
expectConsoleWarningWillFire: expectConsoleWarningWillFire,
|
59
60
|
expectToWarn: expectToWarn,
|
60
61
|
expectToWarnMany: expectToWarnMany,
|
61
62
|
expectWarningWillFire: expectWarningWillFire,
|
62
63
|
FIXTURE_TAG: FIXTURE_TAG,
|
63
64
|
generateTestsFromFixtures: generateTestsFromFixtures,
|
65
|
+
injectPromisePolyfill__DEPRECATED: injectPromisePolyfill__DEPRECATED,
|
64
66
|
matchers: Matchers,
|
65
67
|
printAST: printAST,
|
66
68
|
simpleClone: simpleClone,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
function injectPromisePolyfill_DEPRECATED() {
|
4
|
+
var originalPromise;
|
5
|
+
beforeAll(function () {
|
6
|
+
originalPromise = global.Promise;
|
7
|
+
global.Promise = require('promise-polyfill');
|
8
|
+
});
|
9
|
+
afterAll(function () {
|
10
|
+
global.Promise = originalPromise;
|
11
|
+
});
|
12
|
+
}
|
13
|
+
module.exports = injectPromisePolyfill_DEPRECATED;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "relay-test-utils-internal",
|
3
3
|
"description": "Internal utilities for testing Relay.",
|
4
|
-
"version": "18.
|
4
|
+
"version": "18.2.0",
|
5
5
|
"keywords": [
|
6
6
|
"graphql",
|
7
7
|
"relay"
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"dependencies": {
|
18
18
|
"@babel/runtime": "^7.25.0",
|
19
19
|
"fbjs": "^3.0.2",
|
20
|
-
"relay-runtime": "18.
|
20
|
+
"relay-runtime": "18.2.0"
|
21
21
|
},
|
22
22
|
"directories": {
|
23
23
|
"": "./"
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/**
|
2
|
-
* Relay v18.
|
2
|
+
* Relay v18.2.0
|
3
3
|
*/
|
4
|
-
(()=>{"use strict";var e={115:(e,n,
|
4
|
+
(()=>{"use strict";var e={115:(e,n,r)=>{e.exports={toBeDeeplyFrozen:function(e){return function e(n){if(expect(Object.isFrozen(n)).toBe(!0),Array.isArray(n))n.forEach((function(n){return e(n)}));else if("object"==typeof n&&null!==n)for(var r in n)e(n[r])}(e),{pass:!0}},toWarn:function(e,n){var t=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function a(e){return"["+e.map(o).join(", ")+"]"}function i(e){return e.length?e.map((function(e){return a([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var s=r(520);if(!s.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var c=s.mock.calls.length;e();var l=s.mock.calls.slice(c);return n?(Array.isArray(n)||(n=[n]),{pass:!!l.find((function(e){return e.length===n.length+1&&e.every((function(e,r){if(!r)return!e;var t=n[r-1];return t instanceof RegExp?t.test(e):e===t}))})),message:function(){return"Expected ".concat(t?"not ":"","to warn: ")+"".concat(a([!1].concat(n))," but ")+"`warning` received the following calls: "+"".concat(i(l),".")}}):{pass:!!l.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(t?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(i(l),".")}}}}},815:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("error","expectConsoleError",(function(e){jest.spyOn(console,"error").mockImplementation(e)}));e.exports={disallowConsoleErrors:function(){t.disallowMessages()},expectConsoleErrorWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectConsoleError:function(e,n){return t.expectMessage(e,n)},expectConsoleErrorsMany:function(e,n){return t.expectMessageMany(e,n)}}},489:(e,n,r)=>{var t=(0,r(193).default)(r(759)),o=console.error;e.exports={createConsoleInterceptionSystem:function(e,n,r){var a=!1,i=[],s=[],c=[],l=e.charAt(0).toUpperCase()+e.slice(1),u=l+"s",f="disallow".concat(l,"s");function p(e){var n=i.findIndex((function(n){return e.startsWith(n)})),r=s.findIndex((function(n){return e.startsWith(n)}));if(c.length>0&&e.startsWith(c[0]))c.shift();else if(n>=0)i.splice(n,1);else{if(!(r>=0))throw o("Unexpected ".concat(l,": ")+e),new Error("".concat(l,": ")+e);s.splice(r,1)}}function g(r,o){if(c.length>0)throw new Error("Cannot nest ".concat(n,"() calls."));c.push.apply(c,(0,t.default)(r));var a=o();if(c.length>0){var i=c.toString();throw c.length=0,new Error("Expected ".concat(e," in callback: ").concat(i))}return a}return{disallowMessages:function(){if(a)throw new Error("".concat(f," should be called only once."));a=!0,r(p),afterEach((function(){if(s.length=0,c.length=0,i.length>0){var n=new Error("Some ".concat(i.length," expected ").concat(e,"s where not triggered:\n\n")+Array.from(i,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw i.length=0,n}}))},expectMessageWillFire:function(e,n){if(!a)throw new Error("".concat(f," needs to be called before expect").concat(u,"WillFire"));for(var r=!0===(null==n?void 0:n.optional),t=0;t<(null!==(o=null==n?void 0:n.count)&&void 0!==o?o:1);t++){var o;(r?s:i).push(e)}},expectMessage:function(e,n){return g([e],n)},expectMessageMany:g}}}},15:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("warning","expectConsoleWarning",(function(e){jest.spyOn(console,"warn").mockImplementation(e)}));e.exports={disallowConsoleWarnings:function(){t.disallowMessages()},expectConsoleWarningWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectConsoleWarning:function(e,n){return t.expectMessage(e,n)},expectConsoleWarningsMany:function(e,n){return t.expectMessageMany(e,n)}}},377:(e,n,r)=>{var t=(0,r(193).default)(r(56));e.exports=function(e,n,o){describe.each(e)("".concat(n," - Feature flags: %o"),(function(e){var n;beforeEach((function(){var o=r(268).RelayFeatureFlags;n=(0,t.default)({},o),Object.assign(o,e)})),afterEach((function(){var e=r(268).RelayFeatureFlags;Object.assign(e,n)})),o()}))}},436:(e,n,r)=>{var t=(0,r(193).default)(r(195)),o=r(861),a=r(48),i=r(315),s=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({serialize:function(e){return Object.keys(e).map((function(n){return"~~~~~~~~~~ ".concat(n.toUpperCase()," ~~~~~~~~~~\n").concat(e[n])})).join("\n")},test:function(e){return e&&!0===e[s]}}),e.exports={generateTestsFromFixtures:function(e,n){var r=a.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(r.length>0).toBe(!0)}));var c=r.filter((function(e){return e.startsWith("only.")}));c.length&&(test.skip.each(r.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),r=c),test.each(r)("matches expected output: %s",(function(r){var c,l=a.readFileSync(i.join(e,r),"utf8"),u=o(l,n,r);expect((c={},(0,t.default)(c,s,!0),(0,t.default)(c,"input",l),(0,t.default)(c,"output",u),c)).toMatchSnapshot()}))},FIXTURE_TAG:s}},861:e=>{e.exports=function(e,n,r){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(r)){var t;try{t=n(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(r,"' to throw, but it passed:\n").concat(t))}return n(e)}},310:(e,n,r)=>{var t=r(815),o=t.disallowConsoleErrors,a=t.expectConsoleError,i=t.expectConsoleErrorsMany,s=t.expectConsoleErrorWillFire,c=r(15),l=c.disallowConsoleWarnings,u=c.expectConsoleWarning,f=c.expectConsoleWarningsMany,p=c.expectConsoleWarningWillFire,g=r(377),x=r(436),d=x.FIXTURE_TAG,h=x.generateTestsFromFixtures,v=r(879),y=r(115),w=r(805),E=r(85),m=r(455),W=r(791),b=W.disallowWarnings,C=W.expectToWarn,F=W.expectToWarnMany,M=W.expectWarningWillFire,T=r(371),j=T.createMockEnvironment,A=T.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){var n=process.version.match(/^v(\d+)\./),r=null==n?null:parseInt(n[1],10);return null==r||r<16?"Cannot read property '".concat(e,"' of undefined"):"Cannot read properties of undefined (reading '".concat(e,"')")},createMockEnvironment:j,describeWithFeatureFlags:g,disallowConsoleErrors:o,disallowConsoleWarnings:l,disallowWarnings:b,expectConsoleError:a,expectConsoleErrorsMany:i,expectConsoleErrorWillFire:s,expectConsoleWarning:u,expectConsoleWarningsMany:f,expectConsoleWarningWillFire:p,expectToWarn:C,expectToWarnMany:F,expectWarningWillFire:M,FIXTURE_TAG:d,generateTestsFromFixtures:h,injectPromisePolyfill__DEPRECATED:v,matchers:y,printAST:w,simpleClone:E,skipIf:function(e){for(var n,r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];var a=t.length>0?t[0]:"N/A";console.warn('The test "'.concat(a,'" is being skipped in open source. TODO: T192916613')),"true"===e?(n=test).skip.apply(n,t):test.apply(void 0,t)},trackRetentionForEnvironment:m,unwrapContainer:A}},879:(e,n,r)=>{e.exports=function(){var e;beforeAll((function(){e=global.Promise,global.Promise=r(314)})),afterAll((function(){global.Promise=e}))}},805:(e,n,r)=>{var t=(0,r(193).default)(r(680));function o(e,n){switch(typeof e){case"undefined":return"undefined";case"object":if(null===e)return"null";if(Array.isArray(e)){if(0===e.length)return"[]";var r,a="[\n",i=n+" ",s=(0,t.default)(e);try{for(s.s();!(r=s.n()).done;)a+=i+o(r.value,i)+",\n"}catch(e){s.e(e)}finally{s.f()}return a+(n+"]")}if("string"==typeof e.kind){for(var c="".concat(e.kind," {\n"),l=n+" ",u=0,f=Object.entries(e);u<f.length;u++){var p=f[u],g=p[0],x=p[1];"kind"!==g&&(c+="".concat(l).concat(g,": ").concat(o(x,l),",\n"))}return c+(n+"}")}if("function"==typeof e.toJSON)return o(e.toJSON(),n);for(var d="{\n",h=n+" ",v=0,y=Object.entries(e);v<y.length;v++){var w=y[v],E=w[0],m=w[1];d+="".concat(h).concat(JSON.stringify(E),": ").concat(o(m,h),",\n")}return d+(n+"}");case"string":case"number":case"boolean":return JSON.stringify(e,null,2).replace("\n","\n"+n);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof e,"'."))}}e.exports=function(e){return o(e,"")}},85:e=>{e.exports=function e(n){if(Array.isArray(n))return n.map(e);if(null!=n&&"object"==typeof n){var r={};for(var t in n)r[t]=e(n[t]);return r}return n}},455:e=>{e.exports=function(e){var n=new Map,r=jest.fn((function(e){var r,t=null!==(r=n.get(e))&&void 0!==r?r:NaN;1===t?n.delete(e):n.set(e,t-1)}));return e.retain=jest.fn((function(e){var t,o=e.request.identifier,a=null!==(t=n.get(o))&&void 0!==t?t:0;n.set(o,a+1);var i=!1;return{dispose:function(){i||r(o),i=!0}}})),{release_DEPRECATED:r,isOperationRetained:function(e){var r,t=e.request.identifier;return(null!==(r=n.get(t))&&void 0!==r?r:0)>0}}}},791:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("warning","expectToWarn",(function(e){jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(n,r){for(var t=arguments.length,o=new Array(t>2?t-2:0),a=2;a<t;a++)o[a-2]=arguments[a];if(!n){var i=0,s=r.replace(/%s/g,(function(){return String(o[i++])}));e(s)}}))}))}));e.exports={disallowWarnings:function(){t.disallowMessages()},expectWarningWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectToWarn:function(e,n){return t.expectMessage(e,n)},expectToWarnMany:function(e,n){return t.expectMessageMany(e,n)}}},680:e=>{e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},193:e=>{e.exports=require("@babel/runtime/helpers/interopRequireDefault")},56:e=>{e.exports=require("@babel/runtime/helpers/objectSpread2")},759:e=>{e.exports=require("@babel/runtime/helpers/toConsumableArray")},520:e=>{e.exports=require("fbjs/lib/warning")},48:e=>{e.exports=require("fs")},315:e=>{e.exports=require("path")},314:e=>{e.exports=require("promise-polyfill")},268:e=>{e.exports=require("relay-runtime")},371:e=>{e.exports=require("relay-test-utils")}},n={},r=function r(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}(310);module.exports.RelayTestUtilsInternal=r})();
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/**
|
2
|
-
* Relay v18.
|
2
|
+
* Relay v18.2.0
|
3
3
|
*
|
4
4
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
5
5
|
*
|
6
6
|
* This source code is licensed under the MIT license found in the
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
8
8
|
*/
|
9
|
-
(()=>{"use strict";var e={115:(e,n,
|
9
|
+
(()=>{"use strict";var e={115:(e,n,r)=>{e.exports={toBeDeeplyFrozen:function(e){return function e(n){if(expect(Object.isFrozen(n)).toBe(!0),Array.isArray(n))n.forEach((function(n){return e(n)}));else if("object"==typeof n&&null!==n)for(var r in n)e(n[r])}(e),{pass:!0}},toWarn:function(e,n){var t=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function a(e){return"["+e.map(o).join(", ")+"]"}function i(e){return e.length?e.map((function(e){return a([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var s=r(520);if(!s.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var c=s.mock.calls.length;e();var l=s.mock.calls.slice(c);return n?(Array.isArray(n)||(n=[n]),{pass:!!l.find((function(e){return e.length===n.length+1&&e.every((function(e,r){if(!r)return!e;var t=n[r-1];return t instanceof RegExp?t.test(e):e===t}))})),message:function(){return"Expected ".concat(t?"not ":"","to warn: ")+"".concat(a([!1].concat(n))," but ")+"`warning` received the following calls: "+"".concat(i(l),".")}}):{pass:!!l.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(t?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(i(l),".")}}}}},815:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("error","expectConsoleError",(function(e){jest.spyOn(console,"error").mockImplementation(e)}));e.exports={disallowConsoleErrors:function(){t.disallowMessages()},expectConsoleErrorWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectConsoleError:function(e,n){return t.expectMessage(e,n)},expectConsoleErrorsMany:function(e,n){return t.expectMessageMany(e,n)}}},489:(e,n,r)=>{var t=(0,r(193).default)(r(759)),o=console.error;e.exports={createConsoleInterceptionSystem:function(e,n,r){var a=!1,i=[],s=[],c=[],l=e.charAt(0).toUpperCase()+e.slice(1),u=l+"s",f="disallow".concat(l,"s");function p(e){var n=i.findIndex((function(n){return e.startsWith(n)})),r=s.findIndex((function(n){return e.startsWith(n)}));if(c.length>0&&e.startsWith(c[0]))c.shift();else if(n>=0)i.splice(n,1);else{if(!(r>=0))throw o("Unexpected ".concat(l,": ")+e),new Error("".concat(l,": ")+e);s.splice(r,1)}}function g(r,o){if(c.length>0)throw new Error("Cannot nest ".concat(n,"() calls."));c.push.apply(c,(0,t.default)(r));var a=o();if(c.length>0){var i=c.toString();throw c.length=0,new Error("Expected ".concat(e," in callback: ").concat(i))}return a}return{disallowMessages:function(){if(a)throw new Error("".concat(f," should be called only once."));a=!0,r(p),afterEach((function(){if(s.length=0,c.length=0,i.length>0){var n=new Error("Some ".concat(i.length," expected ").concat(e,"s where not triggered:\n\n")+Array.from(i,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw i.length=0,n}}))},expectMessageWillFire:function(e,n){if(!a)throw new Error("".concat(f," needs to be called before expect").concat(u,"WillFire"));for(var r=!0===(null==n?void 0:n.optional),t=0;t<(null!==(o=null==n?void 0:n.count)&&void 0!==o?o:1);t++){var o;(r?s:i).push(e)}},expectMessage:function(e,n){return g([e],n)},expectMessageMany:g}}}},15:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("warning","expectConsoleWarning",(function(e){jest.spyOn(console,"warn").mockImplementation(e)}));e.exports={disallowConsoleWarnings:function(){t.disallowMessages()},expectConsoleWarningWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectConsoleWarning:function(e,n){return t.expectMessage(e,n)},expectConsoleWarningsMany:function(e,n){return t.expectMessageMany(e,n)}}},377:(e,n,r)=>{var t=(0,r(193).default)(r(56));e.exports=function(e,n,o){describe.each(e)("".concat(n," - Feature flags: %o"),(function(e){var n;beforeEach((function(){var o=r(268).RelayFeatureFlags;n=(0,t.default)({},o),Object.assign(o,e)})),afterEach((function(){var e=r(268).RelayFeatureFlags;Object.assign(e,n)})),o()}))}},436:(e,n,r)=>{var t=(0,r(193).default)(r(195)),o=r(861),a=r(48),i=r(315),s=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({serialize:function(e){return Object.keys(e).map((function(n){return"~~~~~~~~~~ ".concat(n.toUpperCase()," ~~~~~~~~~~\n").concat(e[n])})).join("\n")},test:function(e){return e&&!0===e[s]}}),e.exports={generateTestsFromFixtures:function(e,n){var r=a.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(r.length>0).toBe(!0)}));var c=r.filter((function(e){return e.startsWith("only.")}));c.length&&(test.skip.each(r.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),r=c),test.each(r)("matches expected output: %s",(function(r){var c,l=a.readFileSync(i.join(e,r),"utf8"),u=o(l,n,r);expect((c={},(0,t.default)(c,s,!0),(0,t.default)(c,"input",l),(0,t.default)(c,"output",u),c)).toMatchSnapshot()}))},FIXTURE_TAG:s}},861:e=>{e.exports=function(e,n,r){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(r)){var t;try{t=n(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(r,"' to throw, but it passed:\n").concat(t))}return n(e)}},310:(e,n,r)=>{var t=r(815),o=t.disallowConsoleErrors,a=t.expectConsoleError,i=t.expectConsoleErrorsMany,s=t.expectConsoleErrorWillFire,c=r(15),l=c.disallowConsoleWarnings,u=c.expectConsoleWarning,f=c.expectConsoleWarningsMany,p=c.expectConsoleWarningWillFire,g=r(377),x=r(436),d=x.FIXTURE_TAG,h=x.generateTestsFromFixtures,v=r(879),y=r(115),w=r(805),E=r(85),m=r(455),W=r(791),b=W.disallowWarnings,C=W.expectToWarn,F=W.expectToWarnMany,M=W.expectWarningWillFire,T=r(371),j=T.createMockEnvironment,A=T.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){var n=process.version.match(/^v(\d+)\./),r=null==n?null:parseInt(n[1],10);return null==r||r<16?"Cannot read property '".concat(e,"' of undefined"):"Cannot read properties of undefined (reading '".concat(e,"')")},createMockEnvironment:j,describeWithFeatureFlags:g,disallowConsoleErrors:o,disallowConsoleWarnings:l,disallowWarnings:b,expectConsoleError:a,expectConsoleErrorsMany:i,expectConsoleErrorWillFire:s,expectConsoleWarning:u,expectConsoleWarningsMany:f,expectConsoleWarningWillFire:p,expectToWarn:C,expectToWarnMany:F,expectWarningWillFire:M,FIXTURE_TAG:d,generateTestsFromFixtures:h,injectPromisePolyfill__DEPRECATED:v,matchers:y,printAST:w,simpleClone:E,skipIf:function(e){for(var n,r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];var a=t.length>0?t[0]:"N/A";console.warn('The test "'.concat(a,'" is being skipped in open source. TODO: T192916613')),"true"===e?(n=test).skip.apply(n,t):test.apply(void 0,t)},trackRetentionForEnvironment:m,unwrapContainer:A}},879:(e,n,r)=>{e.exports=function(){var e;beforeAll((function(){e=global.Promise,global.Promise=r(314)})),afterAll((function(){global.Promise=e}))}},805:(e,n,r)=>{var t=(0,r(193).default)(r(680));function o(e,n){switch(typeof e){case"undefined":return"undefined";case"object":if(null===e)return"null";if(Array.isArray(e)){if(0===e.length)return"[]";var r,a="[\n",i=n+" ",s=(0,t.default)(e);try{for(s.s();!(r=s.n()).done;)a+=i+o(r.value,i)+",\n"}catch(e){s.e(e)}finally{s.f()}return a+(n+"]")}if("string"==typeof e.kind){for(var c="".concat(e.kind," {\n"),l=n+" ",u=0,f=Object.entries(e);u<f.length;u++){var p=f[u],g=p[0],x=p[1];"kind"!==g&&(c+="".concat(l).concat(g,": ").concat(o(x,l),",\n"))}return c+(n+"}")}if("function"==typeof e.toJSON)return o(e.toJSON(),n);for(var d="{\n",h=n+" ",v=0,y=Object.entries(e);v<y.length;v++){var w=y[v],E=w[0],m=w[1];d+="".concat(h).concat(JSON.stringify(E),": ").concat(o(m,h),",\n")}return d+(n+"}");case"string":case"number":case"boolean":return JSON.stringify(e,null,2).replace("\n","\n"+n);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof e,"'."))}}e.exports=function(e){return o(e,"")}},85:e=>{e.exports=function e(n){if(Array.isArray(n))return n.map(e);if(null!=n&&"object"==typeof n){var r={};for(var t in n)r[t]=e(n[t]);return r}return n}},455:e=>{e.exports=function(e){var n=new Map,r=jest.fn((function(e){var r,t=null!==(r=n.get(e))&&void 0!==r?r:NaN;1===t?n.delete(e):n.set(e,t-1)}));return e.retain=jest.fn((function(e){var t,o=e.request.identifier,a=null!==(t=n.get(o))&&void 0!==t?t:0;n.set(o,a+1);var i=!1;return{dispose:function(){i||r(o),i=!0}}})),{release_DEPRECATED:r,isOperationRetained:function(e){var r,t=e.request.identifier;return(null!==(r=n.get(t))&&void 0!==r?r:0)>0}}}},791:(e,n,r)=>{var t=(0,r(489).createConsoleInterceptionSystem)("warning","expectToWarn",(function(e){jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(n,r){for(var t=arguments.length,o=new Array(t>2?t-2:0),a=2;a<t;a++)o[a-2]=arguments[a];if(!n){var i=0,s=r.replace(/%s/g,(function(){return String(o[i++])}));e(s)}}))}))}));e.exports={disallowWarnings:function(){t.disallowMessages()},expectWarningWillFire:function(e,n){t.expectMessageWillFire(e,n)},expectToWarn:function(e,n){return t.expectMessage(e,n)},expectToWarnMany:function(e,n){return t.expectMessageMany(e,n)}}},680:e=>{e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},193:e=>{e.exports=require("@babel/runtime/helpers/interopRequireDefault")},56:e=>{e.exports=require("@babel/runtime/helpers/objectSpread2")},759:e=>{e.exports=require("@babel/runtime/helpers/toConsumableArray")},520:e=>{e.exports=require("fbjs/lib/warning")},48:e=>{e.exports=require("fs")},315:e=>{e.exports=require("path")},314:e=>{e.exports=require("promise-polyfill")},268:e=>{e.exports=require("relay-runtime")},371:e=>{e.exports=require("relay-test-utils")}},n={},r=function r(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}(310);module.exports.RelayTestUtilsInternal=r})();
|