Skip to content

Commit

Permalink
chore!: upgrade typescript to v4.1.5 (#1592)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Chen committed Aug 20, 2021
1 parent 5ba3dc7 commit b6c5a1a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dev/conformance/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function runTest(spec: ConformanceProto) {
};

return createInstance(overrides).then(() => {
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const unlisten = watchQuery().onSnapshot(
actualSnap => {
const expectedSnapshot = expectedSnapshots.shift();
Expand Down
10 changes: 5 additions & 5 deletions dev/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import * as gapicConfig from './v1/firestore_client_config.json';
*/
export class Deferred<R> {
promise: Promise<R>;
resolve: (value?: R | Promise<R>) => void = () => {};
reject: (reason?: Error) => void = () => {};
resolve: (value: R | Promise<R>) => void = () => {};
reject: (reason: Error) => void = () => {};

constructor() {
this.promise = new Promise(
this.promise = new Promise<R>(
(
resolve: (value?: R | Promise<R>) => void,
reject: (reason?: Error) => void
resolve: (value: R | Promise<R>) => void,
reject: (reason: Error) => void
) => {
this.resolve = resolve;
this.reject = reject;
Expand Down
4 changes: 2 additions & 2 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ describe('DocumentReference class', () => {
});

it('has set() method', () => {
const allSupportedTypesObject = {
const allSupportedTypesObject: {[field: string]: unknown} = {
stringValue: 'a',
trueValue: true,
falseValue: false,
Expand Down Expand Up @@ -474,7 +474,7 @@ describe('DocumentReference class', () => {
.then(doc => {
const data = doc.data()!;
expect(data.pathValue.path).to.equal(
allSupportedTypesObject.pathValue.path
(allSupportedTypesObject.pathValue as DocumentReference).path
);
delete data.pathValue;
delete allSupportedTypesObject.pathValue;
Expand Down
4 changes: 2 additions & 2 deletions dev/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const allSupportedTypesInput = {
bytesValue: Buffer.from([0x1, 0x2]),
};

const allSupportedTypesOutput = {
const allSupportedTypesOutput: {[field: string]: unknown} = {
stringValue: 'a',
trueValue: true,
falseValue: false,
Expand Down Expand Up @@ -676,7 +676,7 @@ describe('snapshot_() method', () => {
// Deep Equal doesn't support matching instances of DocumentRefs, so we
// compare them manually and remove them from the resulting object.
expect(actualObject.get('pathValue').formattedName).to.equal(
expected.pathValue.formattedName
(expected.pathValue as Firestore.DocumentReference).formattedName
);
const data = actualObject.data()!;
delete data.pathValue;
Expand Down
2 changes: 1 addition & 1 deletion dev/test/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('Client pool', () => {
});

it('garbage collection calls destructor', () => {
const garbageCollect = new Deferred();
const garbageCollect = new Deferred<void>();

const clientPool = new ClientPool<{}>(
1,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"proxyquire": "^2.1.3",
"sinon": "^11.0.0",
"ts-node": "^10.0.0",
"typescript": "3.8.3",
"typescript": "^4.1.5",
"through2": "^4.0.0"
}
}

0 comments on commit b6c5a1a

Please sign in to comment.