Skip to content

Commit

Permalink
Add FDC Integration Tests (#8703)
Browse files Browse the repository at this point in the history
  • Loading branch information
maneesht authored Jan 14, 2025
1 parent 6a82634 commit 21164c2
Show file tree
Hide file tree
Showing 24 changed files with 248 additions and 1,107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-firebase-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: build
run: yarn build:changed firebase-integration
- name: Run tests on changed packages
run: yarn test:changed firebase-integration
run: yarn test:changed firebase-integration
5 changes: 5 additions & 0 deletions packages/data-connect/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Firebase Data Connect

## Local Development

Check `test/dataconnect.yaml` to ensure that the correct values are filled in.
8 changes: 4 additions & 4 deletions packages/data-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p --npm-path npm test:emulator",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator",
"test:all": "run-p --npm-path npm lint test:unit",
"test:browser": "karma start --single-run",
"test": "run-p --npm-path npm lint test:emulator",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:all": "run-p --npm-path npm lint test:browser test:node",
"test:browser": "karma start",
"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",
"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",
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-connect/src/api/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function queryRef<Data, Variables>(
dataConnect: dcInstance,
refType: QUERY_STR,
name: queryName,
variables: variables
variables
};
}
/**
Expand Down
1 change: 1 addition & 0 deletions packages/data-connect/src/network/transport/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export class RESTTransport implements DataConnectTransport {
body: U
) => {
const abortController = new AbortController();

// TODO(mtewani): Update to proper value
const withAuth = this.withRetry(() =>
dcFetch<T, U>(
Expand Down
5 changes: 5 additions & 0 deletions packages/data-connect/test/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "jscore-sandbox-141b5"
}
}
69 changes: 69 additions & 0 deletions packages/data-connect/test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# dataconnect generated files
.dataconnect

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 21164c2

Please sign in to comment.