relay-test-utils-internal 20.1.1 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,7 +18,7 @@ export type WillFireOptions = {
|
|
|
18
18
|
optional?: boolean,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
type API =
|
|
21
|
+
type API = Readonly<{
|
|
22
22
|
disallowMessages: () => void,
|
|
23
23
|
expectMessageWillFire: (string, void | WillFireOptions) => void,
|
|
24
24
|
expectMessage: <T>(string, () => T) => T,
|
|
@@ -27,20 +27,20 @@ type JestDoneFn = {
|
|
|
27
27
|
...
|
|
28
28
|
};
|
|
29
29
|
declare function afterEach(
|
|
30
|
-
fn: (done: JestDoneFn) => ?Promise<
|
|
30
|
+
fn: (done: JestDoneFn) => ?Promise<unknown>,
|
|
31
31
|
timeout?: number,
|
|
32
32
|
): void;
|
|
33
33
|
declare function beforeEach(
|
|
34
|
-
fn: (done: JestDoneFn) => ?Promise<
|
|
34
|
+
fn: (done: JestDoneFn) => ?Promise<unknown>,
|
|
35
35
|
timeout?: number,
|
|
36
36
|
): void;
|
|
37
37
|
declare var describe: {
|
|
38
38
|
(name: JestTestName, fn: () => void): void,
|
|
39
39
|
each(
|
|
40
|
-
...table:
|
|
40
|
+
...table: ReadonlyArray<Array<unknown> | unknown> | [Array<string>, string]
|
|
41
41
|
): (
|
|
42
42
|
name: JestTestName,
|
|
43
|
-
fn?: (...args: Array<any>) => ?Promise<
|
|
43
|
+
fn?: (...args: Array<any>) => ?Promise<unknown>,
|
|
44
44
|
timeout?: number,
|
|
45
45
|
) => void,
|
|
46
46
|
...
|
package/index.js
CHANGED
package/lib/testschema.graphql
CHANGED
|
@@ -26,15 +26,7 @@ directive @fetchable(field_name: String!) on OBJECT
|
|
|
26
26
|
|
|
27
27
|
directive @relay_client_component_server(module_id: String!) on FRAGMENT_SPREAD
|
|
28
28
|
|
|
29
|
-
directive @
|
|
30
|
-
|
|
31
|
-
directive @live_query(
|
|
32
|
-
enabled: Boolean = true
|
|
33
|
-
polling_interval: Int
|
|
34
|
-
config_id: String
|
|
35
|
-
partial: Boolean
|
|
36
|
-
event_stream: String
|
|
37
|
-
) on QUERY
|
|
29
|
+
directive @client_polling(interval: Int) on QUERY
|
|
38
30
|
|
|
39
31
|
type Query {
|
|
40
32
|
checkinSearchQuery(query: CheckinSearchInput): CheckinSearchResult
|
|
@@ -60,6 +52,63 @@ type Query {
|
|
|
60
52
|
fetch__NonNodeStory(input_fetch_id: ID!): NonNodeStory
|
|
61
53
|
nonNodeStory(id: ID!): NonNodeStory
|
|
62
54
|
userOrPage(id: ID!): UserOrPage
|
|
55
|
+
bicycle: Bicycle
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type Bicycle implements Node {
|
|
59
|
+
actor: Actor
|
|
60
|
+
actors: [Actor]
|
|
61
|
+
actorCount: Int
|
|
62
|
+
address: StreetAddress
|
|
63
|
+
allPhones: [Phone]
|
|
64
|
+
author: User
|
|
65
|
+
backgroundImage: Image
|
|
66
|
+
birthdate: Date
|
|
67
|
+
body: Text
|
|
68
|
+
canViewerComment: Boolean
|
|
69
|
+
canViewerLike: Boolean
|
|
70
|
+
comments(
|
|
71
|
+
after: ID
|
|
72
|
+
before: ID
|
|
73
|
+
first: Int
|
|
74
|
+
last: Int
|
|
75
|
+
orderby: String
|
|
76
|
+
): CommentsConnection
|
|
77
|
+
doesViewerLike: Boolean
|
|
78
|
+
emailAddresses: [String]
|
|
79
|
+
feedback: Feedback
|
|
80
|
+
firstName(if: Boolean, unless: Boolean): String
|
|
81
|
+
friends(
|
|
82
|
+
after: ID
|
|
83
|
+
before: ID
|
|
84
|
+
first: Int
|
|
85
|
+
last: Int
|
|
86
|
+
orderby: [String]
|
|
87
|
+
find: String
|
|
88
|
+
isViewerFriend: Boolean
|
|
89
|
+
if: Boolean
|
|
90
|
+
unless: Boolean
|
|
91
|
+
traits: [PersonalityTraits]
|
|
92
|
+
): FriendsConnection
|
|
93
|
+
hometown: Page
|
|
94
|
+
id: ID!
|
|
95
|
+
lastName: String
|
|
96
|
+
likers(first: Int): LikersOfContentConnection
|
|
97
|
+
likeSentence: Text
|
|
98
|
+
message: Text
|
|
99
|
+
name: String
|
|
100
|
+
profilePicture(size: [Int], preset: PhotoSize): Image
|
|
101
|
+
segments(first: Int): Segments
|
|
102
|
+
screennames: [Screenname]
|
|
103
|
+
subscribeStatus: String
|
|
104
|
+
subscribers(first: Int): SubscribersConnection
|
|
105
|
+
topLevelComments(first: Int): TopLevelCommentsConnection
|
|
106
|
+
tracking: String
|
|
107
|
+
url(relative: Boolean, site: String): String
|
|
108
|
+
websites: [String]
|
|
109
|
+
username: String
|
|
110
|
+
viewerSavedState: String
|
|
111
|
+
wheels: Int
|
|
63
112
|
}
|
|
64
113
|
|
|
65
114
|
union UserOrPage = User | Page
|
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": "
|
|
4
|
+
"version": "21.0.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": "
|
|
20
|
+
"relay-runtime": "21.0.0"
|
|
21
21
|
},
|
|
22
22
|
"directories": {
|
|
23
23
|
"": "./"
|
package/printAST.js.flow
CHANGED
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
* prop: value,
|
|
22
22
|
* }
|
|
23
23
|
*/
|
|
24
|
-
function printAST(ast:
|
|
24
|
+
function printAST(ast: unknown): string {
|
|
25
25
|
return printASTImpl(ast, '');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function printASTImpl(ast:
|
|
28
|
+
function printASTImpl(ast: unknown, indent: string): string {
|
|
29
29
|
switch (typeof ast) {
|
|
30
30
|
case 'undefined':
|
|
31
31
|
return 'undefined';
|
|
@@ -33,6 +33,8 @@ function printASTImpl(ast: mixed, indent: string): string {
|
|
|
33
33
|
if (ast === null) {
|
|
34
34
|
return 'null';
|
|
35
35
|
} else if (Array.isArray(ast)) {
|
|
36
|
+
/* $FlowFixMe[invalid-compare] Error discovered during Constant
|
|
37
|
+
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
|
|
36
38
|
if (ast.length === 0) {
|
|
37
39
|
return '[]';
|
|
38
40
|
}
|
package/simpleClone.js.flow
CHANGED
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
*/
|
|
19
19
|
function simpleClone<T>(value: T): T {
|
|
20
20
|
if (Array.isArray(value)) {
|
|
21
|
-
// $FlowFixMe[incompatible-
|
|
21
|
+
// $FlowFixMe[incompatible-type]
|
|
22
22
|
return value.map(simpleClone);
|
|
23
23
|
} else if (value != null && typeof value === 'object') {
|
|
24
|
-
const result: {[string]:
|
|
24
|
+
const result: {[string]: unknown} = {};
|
|
25
25
|
for (const key in value) {
|
|
26
26
|
result[key] = simpleClone(value[key]);
|
|
27
27
|
}
|
|
28
|
-
// $FlowFixMe[incompatible-
|
|
28
|
+
// $FlowFixMe[incompatible-type]
|
|
29
29
|
return result;
|
|
30
30
|
} else {
|
|
31
31
|
return value;
|
|
@@ -23,12 +23,12 @@ import type {OperationDescriptor} from '../relay-runtime/store/RelayStoreTypes';
|
|
|
23
23
|
* should use `isOperationRetained` for new tests as it is much less error-prone.
|
|
24
24
|
*/
|
|
25
25
|
function trackRetentionForEnvironment(environment: IEnvironment): {
|
|
26
|
-
release_DEPRECATED: JestMockFn<[
|
|
26
|
+
release_DEPRECATED: JestMockFn<[unknown], void>,
|
|
27
27
|
isOperationRetained: OperationDescriptor => boolean,
|
|
28
28
|
} {
|
|
29
|
-
const retainCountsByOperation = new Map<
|
|
29
|
+
const retainCountsByOperation = new Map<unknown, number>();
|
|
30
30
|
|
|
31
|
-
const release = jest.fn((id:
|
|
31
|
+
const release = jest.fn((id: unknown) => {
|
|
32
32
|
const existing = retainCountsByOperation.get(id) ?? NaN;
|
|
33
33
|
if (existing === 1) {
|
|
34
34
|
retainCountsByOperation.delete(id);
|