UNPKG

apollo-angular

Version:

Use your GraphQL data in your Angular app, with the Apollo Client

1 lines 21.7 kB
{"version":3,"file":"ngApolloTesting.mjs","sources":["../../testing/src/controller.ts","../../testing/src/operation.ts","../../testing/src/backend.ts","../../testing/src/module.ts","../../testing/src/ngApolloTesting.ts"],"sourcesContent":["import { DocumentNode } from 'graphql';\nimport { Operation, TestOperation } from './operation';\n\nexport type MatchOperationFn = (op: Operation) => boolean;\nexport type MatchOperation = string | DocumentNode | Operation | MatchOperationFn;\n\n/**\n * Controller to be injected into tests, that allows for mocking and flushing\n * of operations.\n *\n *\n */\nexport abstract class ApolloTestingController {\n /**\n * Search for operations that match the given parameter, without any expectations.\n */\n public abstract match(match: MatchOperation): TestOperation[];\n\n /**\n * Expect that a single operation has been made which matches the given URL, and return its\n * mock.\n *\n * If no such operation has been made, or more than one such operation has been made, fail with an\n * error message including the given operation description, if any.\n */\n public abstract expectOne(operationName: string, description?: string): TestOperation;\n\n /**\n * Expect that a single operation has been made which matches the given parameters, and return\n * its mock.\n *\n * If no such operation has been made, or more than one such operation has been made, fail with an\n * error message including the given operation description, if any.\n */\n public abstract expectOne(op: Operation, description?: string): TestOperation;\n\n /**\n * Expect that a single operation has been made which matches the given predicate function, and\n * return its mock.\n *\n * If no such operation has been made, or more than one such operation has been made, fail with an\n * error message including the given operation description, if any.\n */\n public abstract expectOne(matchFn: MatchOperationFn, description?: string): TestOperation;\n\n /**\n * Expect that a single operation has been made which matches the given condition, and return\n * its mock.\n *\n * If no such operation has been made, or more than one such operation has been made, fail with an\n * error message including the given operation description, if any.\n */\n public abstract expectOne(match: MatchOperation, description?: string): TestOperation;\n\n /**\n * Expect that no operations have been made which match the given URL.\n *\n * If a matching operation has been made, fail with an error message including the given\n * description, if any.\n */\n public abstract expectNone(operationName: string, description?: string): void;\n\n /**\n * Expect that no operations have been made which match the given parameters.\n *\n * If a matching operation has been made, fail with an error message including the given\n * description, if any.\n */\n public abstract expectNone(op: Operation, description?: string): void;\n\n /**\n * Expect that no operations have been made which match the given predicate function.\n *\n * If a matching operation has been made, fail with an error message including the given\n * description, if any.\n */\n public abstract expectNone(matchFn: MatchOperationFn, description?: string): void;\n\n /**\n * Expect that no operations have been made which match the given condition.\n *\n * If a matching operation has been made, fail with an error message including the given\n * description, if any.\n */\n public abstract expectNone(match: MatchOperation, description?: string): void;\n\n /**\n * Verify that no unmatched operations are outstanding.\n *\n * If any operations are outstanding, fail with an error message indicating which operations were not\n * handled.\n */\n public abstract verify(): void;\n}\n","import { FormattedExecutionResult, GraphQLError, Kind, OperationTypeNode } from 'graphql';\nimport { Observer } from 'rxjs';\nimport { ApolloError, FetchResult, Operation as LinkOperation } from '@apollo/client/core';\nimport { getMainDefinition } from '@apollo/client/utilities';\n\nconst isApolloError = (err: any): err is ApolloError => err && err.hasOwnProperty('graphQLErrors');\n\nexport type Operation = LinkOperation & {\n clientName: string;\n};\n\nexport class TestOperation<T = { [key: string]: any }> {\n constructor(\n public readonly operation: Operation,\n private readonly observer: Observer<FetchResult<T>>,\n ) {}\n\n public flush(result: FormattedExecutionResult<T> | ApolloError): void {\n if (isApolloError(result)) {\n this.observer.error(result);\n } else {\n const fetchResult = result ? { ...result } : result;\n this.observer.next(fetchResult);\n\n const definition = getMainDefinition(this.operation.query);\n\n if (\n definition.kind === Kind.OPERATION_DEFINITION &&\n definition.operation !== OperationTypeNode.SUBSCRIPTION\n ) {\n this.complete();\n }\n }\n }\n\n public complete() {\n this.observer.complete();\n }\n\n public flushData(data: T | null): void {\n this.flush({\n data,\n });\n }\n\n public networkError(error: Error): void {\n const apolloError = new ApolloError({\n networkError: error,\n });\n\n this.flush(apolloError);\n }\n\n public graphqlErrors(errors: GraphQLError[]): void {\n this.flush({\n errors,\n });\n }\n}\n","import { DocumentNode, print } from 'graphql';\nimport { Observer } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport { FetchResult, Observable as LinkObservable } from '@apollo/client/core';\nimport { ApolloTestingController, MatchOperation } from './controller';\nimport { Operation, TestOperation } from './operation';\n\n/**\n * A testing backend for `Apollo`.\n *\n * `ApolloTestingBackend` works by keeping a list of all open operations.\n * As operations come in, they're added to the list. Users can assert that specific\n * operations were made and then flush them. In the end, a `verify()` method asserts\n * that no unexpected operations were made.\n */\n@Injectable()\nexport class ApolloTestingBackend implements ApolloTestingController {\n /**\n * List of pending operations which have not yet been expected.\n */\n private open: TestOperation[] = [];\n\n /**\n * Handle an incoming operation by queueing it in the list of open operations.\n */\n public handle(op: Operation): LinkObservable<FetchResult> {\n return new LinkObservable((observer: Observer<any>) => {\n const testOp = new TestOperation(op, observer);\n this.open.push(testOp);\n });\n }\n\n /**\n * Helper function to search for operations in the list of open operations.\n */\n private _match(match: MatchOperation): TestOperation[] {\n if (typeof match === 'string') {\n return this.open.filter(testOp => testOp.operation.operationName === match);\n } else if (typeof match === 'function') {\n return this.open.filter(testOp => match(testOp.operation));\n } else {\n if (this.isDocumentNode(match)) {\n return this.open.filter(testOp => print(testOp.operation.query) === print(match));\n }\n\n return this.open.filter(testOp => this.matchOp(match, testOp));\n }\n }\n\n private matchOp(match: Operation, testOp: TestOperation): boolean {\n const variables = JSON.stringify(match.variables);\n const extensions = JSON.stringify(match.extensions);\n\n const sameName = this.compare(match.operationName, testOp.operation.operationName);\n const sameVariables = this.compare(variables, testOp.operation.variables);\n\n const sameQuery = print(testOp.operation.query) === print(match.query);\n\n const sameExtensions = this.compare(extensions, testOp.operation.extensions);\n\n return sameName && sameVariables && sameQuery && sameExtensions;\n }\n\n private compare(expected?: string, value?: Object | string): boolean {\n const received = typeof value === 'string' ? value : JSON.stringify(value);\n\n return !expected || received === expected;\n }\n\n /**\n * Search for operations in the list of open operations, and return all that match\n * without asserting anything about the number of matches.\n */\n public match(match: MatchOperation): TestOperation[] {\n const results = this._match(match);\n\n results.forEach(result => {\n const index = this.open.indexOf(result);\n if (index !== -1) {\n this.open.splice(index, 1);\n }\n });\n return results;\n }\n\n /**\n * Expect that a single outstanding request matches the given matcher, and return\n * it.\n *\n * operations returned through this API will no longer be in the list of open operations,\n * and thus will not match twice.\n */\n public expectOne(match: MatchOperation, description?: string): TestOperation {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(\n `Expected one matching operation for criteria \"${description}\", found ${matches.length} operations.`,\n );\n }\n if (matches.length === 0) {\n throw new Error(`Expected one matching operation for criteria \"${description}\", found none.`);\n }\n return matches[0];\n }\n\n /**\n * Expect that no outstanding operations match the given matcher, and throw an error\n * if any do.\n */\n public expectNone(match: MatchOperation, description?: string): void {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(\n `Expected zero matching operations for criteria \"${description}\", found ${matches.length}.`,\n );\n }\n }\n\n /**\n * Validate that there are no outstanding operations.\n */\n public verify(): void {\n const open = this.open;\n\n if (open.length > 0) {\n // Show the methods and URLs of open operations in the error, for convenience.\n const operations = open.map(testOp => testOp.operation.operationName).join(', ');\n throw new Error(`Expected no open operations, found ${open.length}: ${operations}`);\n }\n }\n\n private isDocumentNode(docOrOp: DocumentNode | Operation): docOrOp is DocumentNode {\n return !(docOrOp as Operation).operationName;\n }\n\n private descriptionFromMatcher(matcher: MatchOperation): string {\n if (typeof matcher === 'string') {\n return `Match operationName: ${matcher}`;\n } else if (typeof matcher === 'object') {\n if (this.isDocumentNode(matcher)) {\n return `Match DocumentNode`;\n }\n\n const name = matcher.operationName || '(any)';\n const variables = JSON.stringify(matcher.variables) || '(any)';\n\n return `Match operation: ${name}, variables: ${variables}`;\n } else {\n return `Match by function: ${matcher.name}`;\n }\n }\n}\n","import { Apollo } from 'apollo-angular';\nimport { Inject, InjectionToken, NgModule, Optional } from '@angular/core';\nimport {\n ApolloCache,\n ApolloLink,\n InMemoryCache,\n Operation as LinkOperation,\n} from '@apollo/client/core';\nimport { ApolloTestingBackend } from './backend';\nimport { ApolloTestingController } from './controller';\nimport { Operation } from './operation';\n\nexport type NamedCaches = Record<string, ApolloCache<any> | undefined | null>;\n\nexport const APOLLO_TESTING_CACHE = new InjectionToken<ApolloCache<any>>(\n 'apollo-angular/testing cache',\n);\n\nexport const APOLLO_TESTING_NAMED_CACHE = new InjectionToken<NamedCaches>(\n 'apollo-angular/testing named cache',\n);\n\nexport const APOLLO_TESTING_CLIENTS = new InjectionToken<string[]>(\n 'apollo-angular/testing named clients',\n);\n\nfunction addClient(name: string, op: LinkOperation): Operation {\n (op as Operation).clientName = name;\n\n return op as Operation;\n}\n\n@NgModule({\n providers: [\n Apollo,\n ApolloTestingBackend,\n { provide: ApolloTestingController, useExisting: ApolloTestingBackend },\n ],\n})\nexport class ApolloTestingModuleCore {\n constructor(\n apollo: Apollo,\n backend: ApolloTestingBackend,\n @Optional()\n @Inject(APOLLO_TESTING_CLIENTS)\n namedClients?: string[],\n @Optional()\n @Inject(APOLLO_TESTING_CACHE)\n cache?: ApolloCache<any>,\n @Optional()\n @Inject(APOLLO_TESTING_NAMED_CACHE)\n namedCaches?: NamedCaches,\n ) {\n function createOptions(name: string, c?: ApolloCache<any> | null) {\n return {\n connectToDevTools: false,\n link: new ApolloLink(operation => backend.handle(addClient(name, operation))),\n cache:\n c ||\n new InMemoryCache({\n addTypename: false,\n }),\n };\n }\n\n apollo.create(createOptions('default', cache));\n\n if (namedClients && namedClients.length) {\n namedClients.forEach(name => {\n const caches = namedCaches && typeof namedCaches === 'object' ? namedCaches : {};\n\n apollo.createNamed(name, createOptions(name, caches[name]));\n });\n }\n }\n}\n\n@NgModule({\n imports: [ApolloTestingModuleCore],\n})\nexport class ApolloTestingModule {\n static withClients(names: string[]) {\n return {\n ngModule: ApolloTestingModuleCore,\n providers: [\n {\n provide: APOLLO_TESTING_CLIENTS,\n useValue: names,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["LinkObservable","i2.ApolloTestingBackend"],"mappings":";;;;;;;;;AAMA;;;;;AAKG;MACmB,uBAAuB,CAAA;AAiF5C;;ACxFD,MAAM,a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