relay-test-utils-internal 0.0.0-main-6de1da8e → 0.0.0-main-3a60494d
Sign up to get free protection for your applications and to get access to all the features.
package/index.js
CHANGED
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-
|
4
|
+
"version": "0.0.0-main-3a60494d",
|
5
5
|
"keywords": [
|
6
6
|
"graphql",
|
7
7
|
"relay"
|
@@ -13,8 +13,8 @@
|
|
13
13
|
"dependencies": {
|
14
14
|
"@babel/runtime": "^7.0.0",
|
15
15
|
"fbjs": "^3.0.0",
|
16
|
-
"relay-runtime": "0.0.0-main-
|
17
|
-
"relay-compiler": "0.0.0-main-
|
16
|
+
"relay-runtime": "0.0.0-main-3a60494d",
|
17
|
+
"relay-compiler": "0.0.0-main-3a60494d"
|
18
18
|
},
|
19
19
|
"peerDependencies": {
|
20
20
|
"graphql": "^15.0.0"
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/**
|
2
|
-
* Relay v0.0.0-main-
|
2
|
+
* Relay v0.0.0-main-3a60494d
|
3
3
|
*/
|
4
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")}]);
|