Skip to content

Commit

Permalink
chore(Codestyle): run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen-byte committed Nov 3, 2024
1 parent 4fb5063 commit f5b6552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions packages/apollo-angular/testing/src/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ export class TestOperation<T = { [key: string]: any }> {
constructor(
public readonly operation: Operation,
private readonly observer: Observer<FetchResult<T>>,
) {
}
) {}

public flush(result: ExecutionResult<T> | ApolloError): void {
if (isApolloError(result)) {
this.observer.error(result);
} else {
const fetchResult = result ? { ...result } : result;
this.observer.next(fetchResult);

const definition = getMainDefinition(this.operation.query);

if (
Expand Down
15 changes: 7 additions & 8 deletions packages/apollo-angular/testing/tests/operation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const testSubscription = gql`
}
`;
const testMutation = gql`
mutation addHero($hero: String!) {
addHero(hero: $hero) {
name
}
mutation addHero($hero: String!) {
addHero(hero: $hero) {
name
}
}
`;

describe('TestOperation', () => {
Expand Down Expand Up @@ -91,7 +91,6 @@ describe('TestOperation', () => {
done();
},
});


const testOperation = mock.expectOne(testSubscription);

Expand All @@ -102,7 +101,7 @@ describe('TestOperation', () => {
testOperation.flushData({
heroes: ['second Hero'],
});

testOperation.complete();
});

Expand All @@ -120,7 +119,7 @@ describe('TestOperation', () => {
data: {
heroes: ['first Hero'],
},
}
},
]);
done();
},
Expand All @@ -138,7 +137,7 @@ describe('TestOperation', () => {
});

test('should close the operation after a mutation', done => {
const operation = buildOperationForLink(testMutation, {hero: 'firstHero'});
const operation = buildOperationForLink(testMutation, { hero: 'firstHero' });
const emittedResults: FetchResult[] = [];

execute(link, operation).subscribe({
Expand Down

0 comments on commit f5b6552

Please sign in to comment.