Skip to content

Commit 21164c2

Browse files
authored
Add FDC Integration Tests (#8703)
1 parent 6a82634 commit 21164c2

File tree

24 files changed

+248
-1107
lines changed

24 files changed

+248
-1107
lines changed

.github/workflows/test-firebase-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: build
4747
run: yarn build:changed firebase-integration
4848
- name: Run tests on changed packages
49-
run: yarn test:changed firebase-integration
49+
run: yarn test:changed firebase-integration

packages/data-connect/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Firebase Data Connect
2+
3+
## Local Development
4+
5+
Check `test/dataconnect.yaml` to ensure that the correct values are filled in.

packages/data-connect/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
3232
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
3333
"dev": "rollup -c -w",
34-
"test": "run-p --npm-path npm test:emulator",
35-
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator",
36-
"test:all": "run-p --npm-path npm lint test:unit",
37-
"test:browser": "karma start --single-run",
34+
"test": "run-p --npm-path npm lint test:emulator",
35+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
36+
"test:all": "run-p --npm-path npm lint test:browser test:node",
37+
"test:browser": "karma start",
3838
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
3939
"test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
4040
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",

packages/data-connect/src/api/query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function queryRef<Data, Variables>(
124124
dataConnect: dcInstance,
125125
refType: QUERY_STR,
126126
name: queryName,
127-
variables: variables
127+
variables
128128
};
129129
}
130130
/**

packages/data-connect/src/network/transport/rest.ts

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export class RESTTransport implements DataConnectTransport {
166166
body: U
167167
) => {
168168
const abortController = new AbortController();
169+
169170
// TODO(mtewani): Update to proper value
170171
const withAuth = this.withRetry(() =>
171172
dcFetch<T, U>(
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "jscore-sandbox-141b5"
4+
}
5+
}

packages/data-connect/test/.gitignore

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
firebase-debug.log*
8+
firebase-debug.*.log*
9+
10+
# Firebase cache
11+
.firebase/
12+
13+
# Firebase config
14+
15+
# Uncomment this if you'd like others to create their own Firebase project.
16+
# For a team working on the same Firebase project(s), it is recommended to leave
17+
# it commented so all members can deploy to the same project(s) in .firebaserc.
18+
# .firebaserc
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36+
.grunt
37+
38+
# Bower dependency directory (https://bower.io/)
39+
bower_components
40+
41+
# node-waf configuration
42+
.lock-wscript
43+
44+
# Compiled binary addons (http://nodejs.org/api/addons.html)
45+
build/Release
46+
47+
# Dependency directories
48+
node_modules/
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
68+
# dataconnect generated files
69+
.dataconnect

packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql

-49
This file was deleted.

packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql

-8
This file was deleted.

packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql

-4
This file was deleted.

0 commit comments

Comments
 (0)