relay-test-utils-internal 0.0.0-main-bfcb5c59 → 0.0.0-main-4467ae84

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-bfcb5c59
2
+ * Relay v0.0.0-main-4467ae84
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
package/index.js.flow CHANGED
@@ -17,10 +17,8 @@ const {
17
17
  generateTestsFromFixtures,
18
18
  } = require('./generateTestsFromFixtures');
19
19
  const Matchers = require('./Matchers');
20
- const parseGraphQLText = require('./parseGraphQLText');
21
20
  const printAST = require('./printAST');
22
21
  const simpleClone = require('./simpleClone');
23
- const {TestSchema, testSchemaPath} = require('./TestSchema');
24
22
  const {
25
23
  disallowWarnings,
26
24
  expectToWarn,
@@ -55,10 +53,7 @@ module.exports = {
55
53
  FIXTURE_TAG,
56
54
  generateTestsFromFixtures,
57
55
  matchers: Matchers,
58
- parseGraphQLText,
59
56
  printAST,
60
57
  simpleClone,
61
- TestSchema,
62
- testSchemaPath,
63
58
  unwrapContainer,
64
59
  };
package/lib/index.js CHANGED
@@ -16,24 +16,18 @@ var _require = require('./generateTestsFromFixtures'),
16
16
 
17
17
  var Matchers = require('./Matchers');
18
18
 
19
- var parseGraphQLText = require('./parseGraphQLText');
20
-
21
19
  var printAST = require('./printAST');
22
20
 
23
21
  var simpleClone = require('./simpleClone');
24
22
 
25
- var _require2 = require('./TestSchema'),
26
- TestSchema = _require2.TestSchema,
27
- testSchemaPath = _require2.testSchemaPath;
28
-
29
- var _require3 = require('./warnings'),
30
- disallowWarnings = _require3.disallowWarnings,
31
- expectToWarn = _require3.expectToWarn,
32
- expectWarningWillFire = _require3.expectWarningWillFire;
23
+ var _require2 = require('./warnings'),
24
+ disallowWarnings = _require2.disallowWarnings,
25
+ expectToWarn = _require2.expectToWarn,
26
+ expectWarningWillFire = _require2.expectWarningWillFire;
33
27
 
34
- var _require4 = require('relay-test-utils'),
35
- createMockEnvironment = _require4.createMockEnvironment,
36
- unwrapContainer = _require4.unwrapContainer; // Apparently, in node v16 (because now they are using V8 V9.something)
28
+ var _require3 = require('relay-test-utils'),
29
+ createMockEnvironment = _require3.createMockEnvironment,
30
+ unwrapContainer = _require3.unwrapContainer; // Apparently, in node v16 (because now they are using V8 V9.something)
37
31
  // the content of the TypeError has changed, and now some of our tests
38
32
  // stated to fail.
39
33
  // This is a temporary work-around to make test pass, but we need to
@@ -61,10 +55,7 @@ module.exports = {
61
55
  FIXTURE_TAG: FIXTURE_TAG,
62
56
  generateTestsFromFixtures: generateTestsFromFixtures,
63
57
  matchers: Matchers,
64
- parseGraphQLText: parseGraphQLText,
65
58
  printAST: printAST,
66
59
  simpleClone: simpleClone,
67
- TestSchema: TestSchema,
68
- testSchemaPath: testSchemaPath,
69
60
  unwrapContainer: unwrapContainer
70
61
  };
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": "0.0.0-main-bfcb5c59",
4
+ "version": "0.0.0-main-4467ae84",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -13,11 +13,7 @@
13
13
  "dependencies": {
14
14
  "@babel/runtime": "^7.0.0",
15
15
  "fbjs": "^3.0.0",
16
- "relay-runtime": "0.0.0-main-bfcb5c59",
17
- "relay-compiler": "0.0.0-main-bfcb5c59"
18
- },
19
- "peerDependencies": {
20
- "graphql": "^15.0.0"
16
+ "relay-runtime": "0.0.0-main-4467ae84"
21
17
  },
22
18
  "directories": {
23
19
  "": "./"
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Relay v0.0.0-main-bfcb5c59
2
+ * Relay v0.0.0-main-4467ae84
3
3
  */
4
- module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("graphql")},function(e,t){e.exports=require("relay-compiler")},function(e,t,n){"use strict";var r=n(6),o=r.FIXTURE_TAG,i=r.generateTestsFromFixtures,c=n(9),a=n(11),u=n(12),s=n(14),f=n(15),l=f.TestSchema,p=f.testSchemaPath,d=n(16),h=d.disallowWarnings,g=d.expectToWarn,x=d.expectWarningWillFire,y=n(17),m=y.createMockEnvironment,v=y.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){return process.version.match(/^v16\.(.+)$/)?"Cannot read properties of undefined (reading '".concat(e,"')"):"Cannot read property '".concat(e,"' of undefined")},createMockEnvironment:m,expectToWarn:g,expectWarningWillFire:x,disallowWarnings:h,FIXTURE_TAG:o,generateTestsFromFixtures:i,matchers:c,parseGraphQLText:a,printAST:u,simpleClone:s,TestSchema:l,testSchemaPath:p,unwrapContainer:v}},function(e,t,n){"use strict";var r=n(0)(n(7)),o=n(8),i=n(1),c=n(2),a=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({print:function(e){return Object.keys(e).map((function(t){return"~~~~~~~~~~ ".concat(t.toUpperCase()," ~~~~~~~~~~\n").concat(e[t])})).join("\n")},test:function(e){return e&&!0===e[a]}}),e.exports={generateTestsFromFixtures:function(e,t){var n=i.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(n.length>0).toBe(!0)}));var u=n.filter((function(e){return e.startsWith("only.")}));u.length&&(test.skip.each(n.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),n=u),test.each(n)("matches expected output: %s",(function(n){var u,s=i.readFileSync(c.join(e,n),"utf8"),f=o(s,t,n);expect((u={},(0,r.default)(u,a,!0),(0,r.default)(u,"input",s),(0,r.default)(u,"output",f),u)).toMatchSnapshot()}))},FIXTURE_TAG:a}},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t,n){"use strict";e.exports=function(e,t,n){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(n)){var r;try{r=t(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(n,"' to throw, but it passed:\n").concat(r))}return t(e)}},function(e,t,n){"use strict";e.exports={toBeDeeplyFrozen:function(e){return function e(t){if(expect(Object.isFrozen(t)).toBe(!0),Array.isArray(t))t.forEach((function(t){return e(t)}));else if("object"==typeof t&&null!==t)for(var n in t)e(t[n])}(e),{pass:!0}},toWarn:function(e,t){var r=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function i(e){return"["+e.map(o).join(", ")+"]"}function c(e){return e.length?e.map((function(e){return i([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var a=n(10);if(!a.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var u=a.mock.calls.length;e();var s=a.mock.calls.slice(u);return t?(Array.isArray(t)||(t=[t]),{pass:!!s.find((function(e){return e.length===t.length+1&&e.every((function(e,n){if(!n)return!e;var r=t[n-1];return r instanceof RegExp?r.test(e):e===r}))})),message:function(){return"Expected ".concat(r?"not ":"","to warn: ")+"".concat(i([!1].concat(t))," but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}):{pass:!!s.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(r?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}}}},function(e,t){e.exports=require("fbjs/lib/warning")},function(e,t,n){"use strict";var r=n(3).parse,o=n(4),i=o.Parser,c=o.convertASTDocuments;e.exports=function(e,t){var n=r(t),o=e.extend(n);return{definitions:c(o,[n],i.transform.bind(i)),schema:o}}},function(e,t,n){"use strict";var r=n(0)(n(13));e.exports=function(e){return function e(t,n){switch(typeof t){case"undefined":return"undefined";case"object":if(null===t)return"null";if(Array.isArray(t)){if(0===t.length)return"[]";var o,i="[\n",c=n+" ",a=(0,r.default)(t);try{for(a.s();!(o=a.n()).done;){var u=o.value;i+=c+e(u,c)+",\n"}}catch(e){a.e(e)}finally{a.f()}return i+=n+"]"}if("string"==typeof t.kind){for(var s="".concat(t.kind," {\n"),f=n+" ",l=0,p=Object.entries(t);l<p.length;l++){var d=p[l],h=d[0],g=d[1];"kind"!==h&&(s+="".concat(f).concat(h,": ").concat(e(g,f),",\n"))}return s+=n+"}"}if("function"==typeof t.toJSON)return e(t.toJSON(),n);for(var x="{\n",y=n+" ",m=0,v=Object.entries(t);m<v.length;m++){var w=v[m],b=w[0],S=w[1];x+="".concat(y).concat(JSON.stringify(b),": ").concat(e(S,y),",\n")}return x+=n+"}";case"string":case"number":case"boolean":return JSON.stringify(t,null,2).replace("\n","\n"+n);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof t,"'."))}}(e,"")}},function(e,t){e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},function(e,t,n){"use strict";e.exports=function e(t){if(Array.isArray(t))return t.map(e);if(null!=t&&"object"==typeof t){var n={};for(var r in t)n[r]=e(t[r]);return n}return t}},function(e,t,n){"use strict";(function(t){var r=n(1),o=n(3).Source,i=n(2),c=n(4).Schema.create,a=i.join(t,"testschema.graphql");e.exports={TestSchema:c(new o(r.readFileSync(a,"utf8"))),testSchemaPath:a}}).call(this,"/")},function(e,t,n){"use strict";var r=!1,o=[],i=null;e.exports={disallowWarnings:function(){if(r)throw new Error("`disallowWarnings` should be called at most once");r=!0,jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),c=2;c<n;c++)r[c-2]=arguments[c];if(!e){var a=0,u=t.replace(/%s/g,(function(){return String(r[a++])})),s=o.indexOf(u);if(null!=i&&i===u)i=null;else{if(!(s>=0))throw console.error("Unexpected Warning: "+u),new Error("Warning: "+u);o.splice(s,1)}}}))})),afterEach((function(){if(o.length>0){var e=new Error("Some expected warnings where not triggered:\n\n"+Array.from(o,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw o.length=0,e}}))},expectWarningWillFire:function(e){if(!r)throw new Error("`disallowWarnings` needs to be called before `expectWarningWillFire`");o.push(e)},expectToWarn:function(e,t){if(null!=i)throw new Error("Cannot nest `expectToWarn()` calls.");i=e;var n=t();if(null!=i)throw i=null,new Error("Expected callback to warn: ".concat(e));return n}}},function(e,t){e.exports=require("relay-test-utils")}]);
4
+ module.exports=function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},function(e,n,t){"use strict";var r=t(2),o=r.FIXTURE_TAG,i=r.generateTestsFromFixtures,c=t(7),a=t(9),u=t(11),s=t(12),f=s.disallowWarnings,l=s.expectToWarn,p=s.expectWarningWillFire,d=t(13),g=d.createMockEnvironment,h=d.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){return process.version.match(/^v16\.(.+)$/)?"Cannot read properties of undefined (reading '".concat(e,"')"):"Cannot read property '".concat(e,"' of undefined")},createMockEnvironment:g,expectToWarn:l,expectWarningWillFire:p,disallowWarnings:f,FIXTURE_TAG:o,generateTestsFromFixtures:i,matchers:c,printAST:a,simpleClone:u,unwrapContainer:h}},function(e,n,t){"use strict";var r=t(0)(t(3)),o=t(4),i=t(5),c=t(6),a=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({print: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[a]}}),e.exports={generateTestsFromFixtures:function(e,n){var t=i.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(t.length>0).toBe(!0)}));var u=t.filter((function(e){return e.startsWith("only.")}));u.length&&(test.skip.each(t.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),t=u),test.each(t)("matches expected output: %s",(function(t){var u,s=i.readFileSync(c.join(e,t),"utf8"),f=o(s,n,t);expect((u={},(0,r.default)(u,a,!0),(0,r.default)(u,"input",s),(0,r.default)(u,"output",f),u)).toMatchSnapshot()}))},FIXTURE_TAG:a}},function(e,n){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,n,t){"use strict";e.exports=function(e,n,t){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(t)){var r;try{r=n(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(t,"' to throw, but it passed:\n").concat(r))}return n(e)}},function(e,n){e.exports=require("fs")},function(e,n){e.exports=require("path")},function(e,n,t){"use strict";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 t in n)e(n[t])}(e),{pass:!0}},toWarn:function(e,n){var r=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function i(e){return"["+e.map(o).join(", ")+"]"}function c(e){return e.length?e.map((function(e){return i([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var a=t(8);if(!a.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var u=a.mock.calls.length;e();var s=a.mock.calls.slice(u);return n?(Array.isArray(n)||(n=[n]),{pass:!!s.find((function(e){return e.length===n.length+1&&e.every((function(e,t){if(!t)return!e;var r=n[t-1];return r instanceof RegExp?r.test(e):e===r}))})),message:function(){return"Expected ".concat(r?"not ":"","to warn: ")+"".concat(i([!1].concat(n))," but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}):{pass:!!s.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(r?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}}}},function(e,n){e.exports=require("fbjs/lib/warning")},function(e,n,t){"use strict";var r=t(0)(t(10));e.exports=function(e){return function e(n,t){switch(typeof n){case"undefined":return"undefined";case"object":if(null===n)return"null";if(Array.isArray(n)){if(0===n.length)return"[]";var o,i="[\n",c=t+" ",a=(0,r.default)(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;i+=c+e(u,c)+",\n"}}catch(e){a.e(e)}finally{a.f()}return i+=t+"]"}if("string"==typeof n.kind){for(var s="".concat(n.kind," {\n"),f=t+" ",l=0,p=Object.entries(n);l<p.length;l++){var d=p[l],g=d[0],h=d[1];"kind"!==g&&(s+="".concat(f).concat(g,": ").concat(e(h,f),",\n"))}return s+=t+"}"}if("function"==typeof n.toJSON)return e(n.toJSON(),t);for(var x="{\n",y=t+" ",v=0,w=Object.entries(n);v<w.length;v++){var b=w[v],m=b[0],E=b[1];x+="".concat(y).concat(JSON.stringify(m),": ").concat(e(E,y),",\n")}return x+=t+"}";case"string":case"number":case"boolean":return JSON.stringify(n,null,2).replace("\n","\n"+t);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof n,"'."))}}(e,"")}},function(e,n){e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},function(e,n,t){"use strict";e.exports=function e(n){if(Array.isArray(n))return n.map(e);if(null!=n&&"object"==typeof n){var t={};for(var r in n)t[r]=e(n[r]);return t}return n}},function(e,n,t){"use strict";var r=!1,o=[],i=null;e.exports={disallowWarnings:function(){if(r)throw new Error("`disallowWarnings` should be called at most once");r=!0,jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(e,n){for(var t=arguments.length,r=new Array(t>2?t-2:0),c=2;c<t;c++)r[c-2]=arguments[c];if(!e){var a=0,u=n.replace(/%s/g,(function(){return String(r[a++])})),s=o.indexOf(u);if(null!=i&&i===u)i=null;else{if(!(s>=0))throw console.error("Unexpected Warning: "+u),new Error("Warning: "+u);o.splice(s,1)}}}))})),afterEach((function(){if(o.length>0){var e=new Error("Some expected warnings where not triggered:\n\n"+Array.from(o,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw o.length=0,e}}))},expectWarningWillFire:function(e){if(!r)throw new Error("`disallowWarnings` needs to be called before `expectWarningWillFire`");o.push(e)},expectToWarn:function(e,n){if(null!=i)throw new Error("Cannot nest `expectToWarn()` calls.");i=e;var t=n();if(null!=i)throw i=null,new Error("Expected callback to warn: ".concat(e));return t}}},function(e,n){e.exports=require("relay-test-utils")}]);
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Relay v0.0.0-main-bfcb5c59
2
+ * Relay v0.0.0-main-4467ae84
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its 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
- module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("graphql")},function(e,t){e.exports=require("relay-compiler")},function(e,t,n){"use strict";var r=n(6),o=r.FIXTURE_TAG,i=r.generateTestsFromFixtures,c=n(9),a=n(11),u=n(12),s=n(14),f=n(15),l=f.TestSchema,p=f.testSchemaPath,d=n(16),h=d.disallowWarnings,g=d.expectToWarn,x=d.expectWarningWillFire,y=n(17),m=y.createMockEnvironment,v=y.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){return process.version.match(/^v16\.(.+)$/)?"Cannot read properties of undefined (reading '".concat(e,"')"):"Cannot read property '".concat(e,"' of undefined")},createMockEnvironment:m,expectToWarn:g,expectWarningWillFire:x,disallowWarnings:h,FIXTURE_TAG:o,generateTestsFromFixtures:i,matchers:c,parseGraphQLText:a,printAST:u,simpleClone:s,TestSchema:l,testSchemaPath:p,unwrapContainer:v}},function(e,t,n){"use strict";var r=n(0)(n(7)),o=n(8),i=n(1),c=n(2),a=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({print:function(e){return Object.keys(e).map((function(t){return"~~~~~~~~~~ ".concat(t.toUpperCase()," ~~~~~~~~~~\n").concat(e[t])})).join("\n")},test:function(e){return e&&!0===e[a]}}),e.exports={generateTestsFromFixtures:function(e,t){var n=i.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(n.length>0).toBe(!0)}));var u=n.filter((function(e){return e.startsWith("only.")}));u.length&&(test.skip.each(n.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),n=u),test.each(n)("matches expected output: %s",(function(n){var u,s=i.readFileSync(c.join(e,n),"utf8"),f=o(s,t,n);expect((u={},(0,r.default)(u,a,!0),(0,r.default)(u,"input",s),(0,r.default)(u,"output",f),u)).toMatchSnapshot()}))},FIXTURE_TAG:a}},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t,n){"use strict";e.exports=function(e,t,n){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(n)){var r;try{r=t(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(n,"' to throw, but it passed:\n").concat(r))}return t(e)}},function(e,t,n){"use strict";e.exports={toBeDeeplyFrozen:function(e){return function e(t){if(expect(Object.isFrozen(t)).toBe(!0),Array.isArray(t))t.forEach((function(t){return e(t)}));else if("object"==typeof t&&null!==t)for(var n in t)e(t[n])}(e),{pass:!0}},toWarn:function(e,t){var r=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function i(e){return"["+e.map(o).join(", ")+"]"}function c(e){return e.length?e.map((function(e){return i([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var a=n(10);if(!a.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var u=a.mock.calls.length;e();var s=a.mock.calls.slice(u);return t?(Array.isArray(t)||(t=[t]),{pass:!!s.find((function(e){return e.length===t.length+1&&e.every((function(e,n){if(!n)return!e;var r=t[n-1];return r instanceof RegExp?r.test(e):e===r}))})),message:function(){return"Expected ".concat(r?"not ":"","to warn: ")+"".concat(i([!1].concat(t))," but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}):{pass:!!s.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(r?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}}}},function(e,t){e.exports=require("fbjs/lib/warning")},function(e,t,n){"use strict";var r=n(3).parse,o=n(4),i=o.Parser,c=o.convertASTDocuments;e.exports=function(e,t){var n=r(t),o=e.extend(n);return{definitions:c(o,[n],i.transform.bind(i)),schema:o}}},function(e,t,n){"use strict";var r=n(0)(n(13));e.exports=function(e){return function e(t,n){switch(typeof t){case"undefined":return"undefined";case"object":if(null===t)return"null";if(Array.isArray(t)){if(0===t.length)return"[]";var o,i="[\n",c=n+" ",a=(0,r.default)(t);try{for(a.s();!(o=a.n()).done;){var u=o.value;i+=c+e(u,c)+",\n"}}catch(e){a.e(e)}finally{a.f()}return i+=n+"]"}if("string"==typeof t.kind){for(var s="".concat(t.kind," {\n"),f=n+" ",l=0,p=Object.entries(t);l<p.length;l++){var d=p[l],h=d[0],g=d[1];"kind"!==h&&(s+="".concat(f).concat(h,": ").concat(e(g,f),",\n"))}return s+=n+"}"}if("function"==typeof t.toJSON)return e(t.toJSON(),n);for(var x="{\n",y=n+" ",m=0,v=Object.entries(t);m<v.length;m++){var w=v[m],b=w[0],S=w[1];x+="".concat(y).concat(JSON.stringify(b),": ").concat(e(S,y),",\n")}return x+=n+"}";case"string":case"number":case"boolean":return JSON.stringify(t,null,2).replace("\n","\n"+n);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof t,"'."))}}(e,"")}},function(e,t){e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},function(e,t,n){"use strict";e.exports=function e(t){if(Array.isArray(t))return t.map(e);if(null!=t&&"object"==typeof t){var n={};for(var r in t)n[r]=e(t[r]);return n}return t}},function(e,t,n){"use strict";(function(t){var r=n(1),o=n(3).Source,i=n(2),c=n(4).Schema.create,a=i.join(t,"testschema.graphql");e.exports={TestSchema:c(new o(r.readFileSync(a,"utf8"))),testSchemaPath:a}}).call(this,"/")},function(e,t,n){"use strict";var r=!1,o=[],i=null;e.exports={disallowWarnings:function(){if(r)throw new Error("`disallowWarnings` should be called at most once");r=!0,jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),c=2;c<n;c++)r[c-2]=arguments[c];if(!e){var a=0,u=t.replace(/%s/g,(function(){return String(r[a++])})),s=o.indexOf(u);if(null!=i&&i===u)i=null;else{if(!(s>=0))throw console.error("Unexpected Warning: "+u),new Error("Warning: "+u);o.splice(s,1)}}}))})),afterEach((function(){if(o.length>0){var e=new Error("Some expected warnings where not triggered:\n\n"+Array.from(o,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw o.length=0,e}}))},expectWarningWillFire:function(e){if(!r)throw new Error("`disallowWarnings` needs to be called before `expectWarningWillFire`");o.push(e)},expectToWarn:function(e,t){if(null!=i)throw new Error("Cannot nest `expectToWarn()` calls.");i=e;var n=t();if(null!=i)throw i=null,new Error("Expected callback to warn: ".concat(e));return n}}},function(e,t){e.exports=require("relay-test-utils")}]);
9
+ module.exports=function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},function(e,n,t){"use strict";var r=t(2),o=r.FIXTURE_TAG,i=r.generateTestsFromFixtures,c=t(7),a=t(9),u=t(11),s=t(12),f=s.disallowWarnings,l=s.expectToWarn,p=s.expectWarningWillFire,d=t(13),g=d.createMockEnvironment,h=d.unwrapContainer;e.exports={cannotReadPropertyOfUndefined__DEPRECATED:function(e){return process.version.match(/^v16\.(.+)$/)?"Cannot read properties of undefined (reading '".concat(e,"')"):"Cannot read property '".concat(e,"' of undefined")},createMockEnvironment:g,expectToWarn:l,expectWarningWillFire:p,disallowWarnings:f,FIXTURE_TAG:o,generateTestsFromFixtures:i,matchers:c,printAST:a,simpleClone:u,unwrapContainer:h}},function(e,n,t){"use strict";var r=t(0)(t(3)),o=t(4),i=t(5),c=t(6),a=Symbol.for("FIXTURE_TAG");expect.addSnapshotSerializer({print: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[a]}}),e.exports={generateTestsFromFixtures:function(e,n){var t=i.readdirSync(e);test("has fixtures in ".concat(e),(function(){expect(t.length>0).toBe(!0)}));var u=t.filter((function(e){return e.startsWith("only.")}));u.length&&(test.skip.each(t.filter((function(e){return!e.startsWith("only.")})))("matches expected output: %s",(function(){})),t=u),test.each(t)("matches expected output: %s",(function(t){var u,s=i.readFileSync(c.join(e,t),"utf8"),f=o(s,n,t);expect((u={},(0,r.default)(u,a,!0),(0,r.default)(u,"input",s),(0,r.default)(u,"output",f),u)).toMatchSnapshot()}))},FIXTURE_TAG:a}},function(e,n){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,n,t){"use strict";e.exports=function(e,n,t){if(/^# *expected-to-throw/.test(e)||/\.error\.\w+$/.test(t)){var r;try{r=n(e)}catch(e){return"THROWN EXCEPTION:\n\n".concat(e.toString())}throw new Error("Expected test file '".concat(t,"' to throw, but it passed:\n").concat(r))}return n(e)}},function(e,n){e.exports=require("fs")},function(e,n){e.exports=require("path")},function(e,n,t){"use strict";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 t in n)e(n[t])}(e),{pass:!0}},toWarn:function(e,n){var r=this.isNot;function o(e){return e instanceof RegExp?e.toString():JSON.stringify(e)}function i(e){return"["+e.map(o).join(", ")+"]"}function c(e){return e.length?e.map((function(e){return i([!!e[0]].concat(e.slice(1)))})).join(", "):"[]"}var a=t(8);if(!a.mock)throw new Error("toWarn(): Requires `jest.mock('warning')`.");var u=a.mock.calls.length;e();var s=a.mock.calls.slice(u);return n?(Array.isArray(n)||(n=[n]),{pass:!!s.find((function(e){return e.length===n.length+1&&e.every((function(e,t){if(!t)return!e;var r=n[t-1];return r instanceof RegExp?r.test(e):e===r}))})),message:function(){return"Expected ".concat(r?"not ":"","to warn: ")+"".concat(i([!1].concat(n))," but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}):{pass:!!s.filter((function(e){return!e[0]})).length,message:function(){return"Expected ".concat(r?"not ":"","to warn but ")+"`warning` received the following calls: "+"".concat(c(s),".")}}}}},function(e,n){e.exports=require("fbjs/lib/warning")},function(e,n,t){"use strict";var r=t(0)(t(10));e.exports=function(e){return function e(n,t){switch(typeof n){case"undefined":return"undefined";case"object":if(null===n)return"null";if(Array.isArray(n)){if(0===n.length)return"[]";var o,i="[\n",c=t+" ",a=(0,r.default)(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;i+=c+e(u,c)+",\n"}}catch(e){a.e(e)}finally{a.f()}return i+=t+"]"}if("string"==typeof n.kind){for(var s="".concat(n.kind," {\n"),f=t+" ",l=0,p=Object.entries(n);l<p.length;l++){var d=p[l],g=d[0],h=d[1];"kind"!==g&&(s+="".concat(f).concat(g,": ").concat(e(h,f),",\n"))}return s+=t+"}"}if("function"==typeof n.toJSON)return e(n.toJSON(),t);for(var x="{\n",y=t+" ",v=0,w=Object.entries(n);v<w.length;v++){var b=w[v],m=b[0],E=b[1];x+="".concat(y).concat(JSON.stringify(m),": ").concat(e(E,y),",\n")}return x+=t+"}";case"string":case"number":case"boolean":return JSON.stringify(n,null,2).replace("\n","\n"+t);default:throw new Error("printAST doesn't handle values where "+"typeof value === '".concat(typeof n,"'."))}}(e,"")}},function(e,n){e.exports=require("@babel/runtime/helpers/createForOfIteratorHelper")},function(e,n,t){"use strict";e.exports=function e(n){if(Array.isArray(n))return n.map(e);if(null!=n&&"object"==typeof n){var t={};for(var r in n)t[r]=e(n[r]);return t}return n}},function(e,n,t){"use strict";var r=!1,o=[],i=null;e.exports={disallowWarnings:function(){if(r)throw new Error("`disallowWarnings` should be called at most once");r=!0,jest.mock("fbjs/lib/warning",(function(){return jest.fn((function(e,n){for(var t=arguments.length,r=new Array(t>2?t-2:0),c=2;c<t;c++)r[c-2]=arguments[c];if(!e){var a=0,u=n.replace(/%s/g,(function(){return String(r[a++])})),s=o.indexOf(u);if(null!=i&&i===u)i=null;else{if(!(s>=0))throw console.error("Unexpected Warning: "+u),new Error("Warning: "+u);o.splice(s,1)}}}))})),afterEach((function(){if(o.length>0){var e=new Error("Some expected warnings where not triggered:\n\n"+Array.from(o,(function(e){return" * ".concat(e)})).join("\n")+"\n");throw o.length=0,e}}))},expectWarningWillFire:function(e){if(!r)throw new Error("`disallowWarnings` needs to be called before `expectWarningWillFire`");o.push(e)},expectToWarn:function(e,n){if(null!=i)throw new Error("Cannot nest `expectToWarn()` calls.");i=e;var t=n();if(null!=i)throw i=null,new Error("Expected callback to warn: ".concat(e));return t}}},function(e,n){e.exports=require("relay-test-utils")}]);
@@ -1,32 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its 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
- * @flow strict-local
8
- * @format
9
- */
10
-
11
- // flowlint ambiguous-object-type:error
12
-
13
- 'use strict';
14
-
15
- import type {Schema} from 'relay-compiler';
16
-
17
- const fs = require('fs');
18
- const {Source} = require('graphql');
19
- const path = require('path');
20
- const {
21
- Schema: {create},
22
- } = require('relay-compiler');
23
-
24
- const testSchemaPath = (path.join(__dirname, 'testschema.graphql'): string);
25
-
26
- module.exports = ({
27
- TestSchema: create(new Source(fs.readFileSync(testSchemaPath, 'utf8'))),
28
- testSchemaPath,
29
- }: {|
30
- +TestSchema: Schema,
31
- +testSchemaPath: string,
32
- |});
package/lib/TestSchema.js DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its 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
- *
8
- * @format
9
- */
10
- // flowlint ambiguous-object-type:error
11
- 'use strict';
12
-
13
- var fs = require('fs');
14
-
15
- var _require = require('graphql'),
16
- Source = _require.Source;
17
-
18
- var path = require('path');
19
-
20
- var _require2 = require('relay-compiler'),
21
- create = _require2.Schema.create;
22
-
23
- var testSchemaPath = path.join(__dirname, 'testschema.graphql');
24
- module.exports = {
25
- TestSchema: create(new Source(fs.readFileSync(testSchemaPath, 'utf8'))),
26
- testSchemaPath: testSchemaPath
27
- };
@@ -1,30 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its 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
- *
8
- * @format
9
- */
10
- // flowlint ambiguous-object-type:error
11
- 'use strict';
12
-
13
- var _require = require('graphql'),
14
- parse = _require.parse;
15
-
16
- var _require2 = require('relay-compiler'),
17
- Parser = _require2.Parser,
18
- convertASTDocuments = _require2.convertASTDocuments;
19
-
20
- function parseGraphQLText(schema, text) {
21
- var ast = parse(text);
22
- var extendedSchema = schema.extend(ast);
23
- var definitions = convertASTDocuments(extendedSchema, [ast], Parser.transform.bind(Parser));
24
- return {
25
- definitions: definitions,
26
- schema: extendedSchema
27
- };
28
- }
29
-
30
- module.exports = parseGraphQLText;
@@ -1,41 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its 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
- * @flow strict-local
8
- * @format
9
- */
10
-
11
- // flowlint ambiguous-object-type:error
12
-
13
- 'use strict';
14
-
15
- import type {Fragment, Root, Schema} from 'relay-compiler';
16
-
17
- const {parse} = require('graphql');
18
- const {Parser, convertASTDocuments} = require('relay-compiler');
19
-
20
- function parseGraphQLText(
21
- schema: Schema,
22
- text: string,
23
- ): {
24
- definitions: $ReadOnlyArray<Fragment | Root>,
25
- schema: Schema,
26
- ...
27
- } {
28
- const ast = parse(text);
29
- const extendedSchema = schema.extend(ast);
30
- const definitions = convertASTDocuments(
31
- extendedSchema,
32
- [ast],
33
- Parser.transform.bind(Parser),
34
- );
35
- return {
36
- definitions,
37
- schema: extendedSchema,
38
- };
39
- }
40
-
41
- module.exports = parseGraphQLText;