Skip to content

fix(*): Fix compilation problems in my local environment #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,18 @@ gulp --tasks

## Testing the SDK

To run all tests for the SDK simply run: `npm test` at the root of this package.
To run all tests for the SDK you must first supply a firebase project config for
your tests. This is done by creating a file called `project.json` and at the
following path:

```
tests/config/project.json
```

This file should contain a JSON object with your app information (i.e. the same
information you would pass to `firebase.initializeApp`).

After you have done this, simply run: `npm test` at the root of this package.

There are several types of available tests:

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-spec-reporter": "^0.0.30",
"karma-typescript": "^3.0.1",
"karma-typescript": "^3.0.4",
"merge2": "^1.0.3",
"mkdirp": "^0.5.1",
"require-dir": "^0.3.1",
"rimraf": "^2.6.1",
"shx": "^0.2.2",
"sinon": "^2.1.0",
"through2": "^2.0.3",
"ts-node": "2.1.1",
"typescript": "^2.2.1",
"ts-node": "^3.3.0",
"typescript": "^2.4.2",
"validate-commit-msg": "^2.12.1",
"vinyl-named": "^1.1.0",
"webpack": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/messaging/controllers/window-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default class WindowController extends ControllerInterface {
const serviceWorker = registration.installing || registration.waiting ||
registration.active;

return new Promise((resolve, reject) => {
return new Promise<ServiceWorkerRegistration>((resolve, reject) => {
if (!serviceWorker) {
// This is a rare scenario but has occured in firefox
reject(this.errorFactory_.create(Errors.codes.NO_SW_IN_REG));
Expand Down
2 changes: 1 addition & 1 deletion src/messaging/models/db-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class DBInterface {
private dbVersion_: number;
private openDbPromise_: Promise<IDBDatabase>;
protected errorFactory_: ErrorFactory<string>;
protected TRANSACTION_READ_WRITE: string;
protected TRANSACTION_READ_WRITE: IDBTransactionMode;

/**
* @param {string} dbName
Expand Down
6 changes: 4 additions & 2 deletions src/storage/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,15 @@ export class UploadTask {
/**
* This object behaves like a Promise, and resolves with its snapshot data
* when the upload completes.
* The fulfillment callback. Promise chaining works as normal.
* @param onFulfilled The fulfillment callback. Promise chaining works as normal.
* @param onRejected The rejection callback.
*/
then<U>(onFulfilled?: ((value: UploadTaskSnapshot) => U | PromiseLike<U>) | null, onRejected?: ((error: any) => U | PromiseLike<U>) | null): Promise<U> {
// These casts are needed so that TypeScript can infer the types of the
// resulting Promise.
return this.promise_.then<U>(
(onFulfilled as (value: UploadTaskSnapshot) => U | PromiseLike<U>),
(onRejected as ((error: any) => PromiseLike<U>) | null));
(onRejected as ((error: any) => PromiseLike<never>) | null));
}

/**
Expand Down
76 changes: 57 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"

ansi-styles@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
dependencies:
color-convert "^1.9.0"

anymatch@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507"
Expand Down Expand Up @@ -1335,6 +1341,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d"
dependencies:
ansi-styles "^3.1.0"
escape-string-regexp "^1.0.5"
supports-color "^4.0.0"

child-process-promise@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074"
Expand Down Expand Up @@ -1453,6 +1467,16 @@ collection-visit@^0.2.1:
map-visit "^0.1.5"
object-visit "^0.3.4"

color-convert@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
dependencies:
color-name "^1.1.1"

color-name@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
Expand Down Expand Up @@ -3119,6 +3143,10 @@ has-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"

has-flag@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"

has-gulplog@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce"
Expand Down Expand Up @@ -3774,9 +3802,9 @@ karma-spec-reporter@^0.0.30:
dependencies:
colors "^1.1.2"

karma-typescript@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/karma-typescript/-/karma-typescript-3.0.1.tgz#64619473a68973773ec3132f96be06da7428427e"
karma-typescript@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/karma-typescript/-/karma-typescript-3.0.4.tgz#9cdeeeddd1671693440c34ec62aba2d6ff9e4b05"
dependencies:
acorn "^4.0.4"
amdefine "1.0.0"
Expand Down Expand Up @@ -5066,7 +5094,7 @@ pinkie-promise@^2.0.0:
dependencies:
pinkie "^2.0.0"

pinkie@^2.0.0, pinkie@^2.0.4:
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"

Expand Down Expand Up @@ -5998,6 +6026,12 @@ supports-color@^3.1.0:
dependencies:
has-flag "^1.0.0"

supports-color@^4.0.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836"
dependencies:
has-flag "^2.0.0"

symbol-tree@^3.2.1:
version "3.2.2"
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
Expand Down Expand Up @@ -6222,22 +6256,20 @@ trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"

ts-node@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-2.1.1.tgz#2fe7049ea56319730052a9e677985e6151a7bd31"
ts-node@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.3.0.tgz#c13c6a3024e30be1180dd53038fc209289d4bf69"
dependencies:
arrify "^1.0.0"
chalk "^1.1.1"
chalk "^2.0.0"
diff "^3.1.0"
make-error "^1.1.1"
minimist "^1.2.0"
mkdirp "^0.5.1"
pinkie "^2.0.4"
source-map-support "^0.4.0"
tsconfig "^6.0.0"
v8flags "^2.0.11"
xtend "^4.0.0"
yn "^1.2.0"
v8flags "^3.0.0"
yn "^2.0.0"

tsconfig@^6.0.0:
version "6.0.0"
Expand Down Expand Up @@ -6289,9 +6321,9 @@ typedarray@~0.0.5:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"

typescript@^2.2.1:
version "2.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984"
typescript@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"

uglify-js@^2.6, uglify-js@^2.8.29:
version "2.8.29"
Expand Down Expand Up @@ -6460,12 +6492,18 @@ uuid@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"

v8flags@^2.0.10, v8flags@^2.0.11, v8flags@^2.0.9:
v8flags@^2.0.10, v8flags@^2.0.9:
version "2.1.1"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4"
dependencies:
user-home "^1.1.1"

v8flags@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.0.tgz#4be9604488e0c4123645def705b1848d16b8e01f"
dependencies:
user-home "^1.1.1"

vali-date@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6"
Expand Down Expand Up @@ -6873,6 +6911,6 @@ [email protected]:
version "0.1.2"
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"

yn@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-1.2.0.tgz#d237a4c533f279b2b89d3acac2db4b8c795e4a63"
yn@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"