diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/FirebaseRef.expected b/javascript/ql/test/library-tests/frameworks/Firebase/FirebaseRef.expected index 2bcf33333c4..c9166f2df29 100644 --- a/javascript/ql/test/library-tests/frameworks/Firebase/FirebaseRef.expected +++ b/javascript/ql/test/library-tests/frameworks/Firebase/FirebaseRef.expected @@ -1,3 +1,6 @@ +| src/import_assign.ts:4:3:4:17 | db.ref("hello") | +| src/import_named.ts:4:3:4:17 | db.ref("hello") | +| src/import_star.ts:4:3:4:17 | db.ref("hello") | | tst.js:5:1:5:22 | fb.data ... ef('x') | | tst.js:7:3:7:7 | x.ref | | tst.js:7:3:7:14 | x.ref.parent | diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/node_modules/firebase/index.d.ts b/javascript/ql/test/library-tests/frameworks/Firebase/node_modules/firebase/index.d.ts new file mode 100644 index 00000000000..80ebf68432f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/Firebase/node_modules/firebase/index.d.ts @@ -0,0 +1,10 @@ +// Greatly simplified version of the Firebase d.ts file. + +declare namespace firebase.database { + interface Database { + ref(name: string): any; + } +} + +export = firebase; +export as namespace firebase; diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/src/import_assign.ts b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_assign.ts new file mode 100644 index 00000000000..c201fc9dd4f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_assign.ts @@ -0,0 +1,5 @@ +import firebase = require("firebase"); + +function test(db: firebase.database.Database) { + db.ref("hello"); +} diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/src/import_named.ts b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_named.ts new file mode 100644 index 00000000000..0144f0f24b0 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_named.ts @@ -0,0 +1,5 @@ +import { database } from "firebase"; + +function test(db: database.Database) { + db.ref("hello"); +} diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/src/import_star.ts b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_star.ts new file mode 100644 index 00000000000..d52d84cdfcf --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/Firebase/src/import_star.ts @@ -0,0 +1,5 @@ +import * as firebase from "firebase"; + +function test(db: firebase.database.Database) { + db.ref("hello"); +} diff --git a/javascript/ql/test/library-tests/frameworks/Firebase/tsconfig.json b/javascript/ql/test/library-tests/frameworks/Firebase/tsconfig.json new file mode 100644 index 00000000000..bcd8df0e91c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/Firebase/tsconfig.json @@ -0,0 +1,3 @@ +{ + "include": ["src"] +}