Skip to content

Commit

Permalink
Upgrade TSLint and fix linting issues in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shadaj committed Jul 5, 2017
1 parent 4761712 commit 79efd35
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"rxjs": "^5.0.0-beta.11",
"sinon": "^2.1.0",
"source-map-support": "^0.4.0",
"tslint": "^5.1.0",
"tslint": "^5.5.0",
"typescript": "2.3.4",
"uglify-js": "^3.0.16",
"webpack": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/batchedNetworkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ describe('HTTPBatchedNetworkInterface', () => {

it('middleware should be able to modify requests/options', () => {
const changeMiddleware: BatchMiddlewareInterface = {
applyBatchMiddleware({ options }, next) {
(options as any).headers['Content-Length'] = '18';
applyBatchMiddleware({ options: opts }, next) {
(opts as any).headers['Content-Length'] = '18';
next();
},
};
Expand Down
40 changes: 20 additions & 20 deletions test/optimistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ describe('optimistic mutation results', () => {
updateQueries,
}).then((res) => {
checkBothMutationsAreApplied('This one was created with a mutation.', 'Optimistically generated 2');
const mutationsState = client.store.getState().apollo.mutations;
assert.equal(mutationsState['5'].loading, false);
assert.equal(mutationsState['6'].loading, true);
const latestState = client.store.getState().apollo.mutations;
assert.equal(latestState['5'].loading, false);
assert.equal(latestState['6'].loading, true);

return res;
});
Expand All @@ -331,9 +331,9 @@ describe('optimistic mutation results', () => {
updateQueries,
}).then((res) => {
checkBothMutationsAreApplied('This one was created with a mutation.', 'Second mutation.');
const mutationsState = client.store.getState().apollo.mutations;
assert.equal(mutationsState[5].loading, false);
assert.equal(mutationsState[6].loading, false);
const latestState = client.store.getState().apollo.mutations;
assert.equal(latestState[5].loading, false);
assert.equal(latestState[6].loading, false);

return res;
});
Expand Down Expand Up @@ -486,9 +486,9 @@ describe('optimistic mutation results', () => {
update,
}).then((res) => {
checkBothMutationsAreApplied('This one was created with a mutation.', 'Optimistically generated 2');
const mutationsState = client.store.getState().apollo.mutations;
assert.equal(mutationsState['5'].loading, false);
assert.equal(mutationsState['6'].loading, true);
const latestState = client.store.getState().apollo.mutations;
assert.equal(latestState['5'].loading, false);
assert.equal(latestState['6'].loading, true);

return res;
});
Expand All @@ -499,9 +499,9 @@ describe('optimistic mutation results', () => {
update,
}).then((res) => {
checkBothMutationsAreApplied('This one was created with a mutation.', 'Second mutation.');
const mutationsState = client.store.getState().apollo.mutations;
assert.equal(mutationsState[5].loading, false);
assert.equal(mutationsState[6].loading, false);
const latestState = client.store.getState().apollo.mutations;
assert.equal(latestState[5].loading, false);
assert.equal(latestState[6].loading, false);

return res;
});
Expand Down Expand Up @@ -753,10 +753,10 @@ describe('optimistic mutation results', () => {
optimisticResponse,
updateQueries,
}).then((res) => {
const dataInStore = client.queryManager.getDataWithOptimisticResults();
assert.equal((dataInStore['TodoList5'] as any).todos.length, 5);
assert.equal((dataInStore['Todo99'] as any).text, 'This one was created with a mutation.');
assert.equal((dataInStore['Todo66'] as any).text, 'Optimistically generated 2');
const currentDataInStore = client.queryManager.getDataWithOptimisticResults();
assert.equal((currentDataInStore['TodoList5'] as any).todos.length, 5);
assert.equal((currentDataInStore['Todo99'] as any).text, 'This one was created with a mutation.');
assert.equal((currentDataInStore['Todo66'] as any).text, 'Optimistically generated 2');
return res;
});

Expand Down Expand Up @@ -1105,10 +1105,10 @@ describe('optimistic mutation results', () => {
optimisticResponse,
update,
}).then((res) => {
const dataInStore = client.queryManager.getDataWithOptimisticResults();
assert.equal((dataInStore['TodoList5'] as any).todos.length, 5);
assert.equal((dataInStore['Todo99'] as any).text, 'This one was created with a mutation.');
assert.equal((dataInStore['Todo66'] as any).text, 'Optimistically generated 2');
const currentDataInStore = client.queryManager.getDataWithOptimisticResults();
assert.equal((currentDataInStore['TodoList5'] as any).todos.length, 5);
assert.equal((currentDataInStore['Todo99'] as any).text, 'This one was created with a mutation.');
assert.equal((currentDataInStore['Todo66'] as any).text, 'Optimistically generated 2');
return res;
});

Expand Down

0 comments on commit 79efd35

Please sign in to comment.