Skip to content

Commit

Permalink
Update test to use new internal command.
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold committed Dec 13, 2022
1 parent 36ef17c commit cce0388
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions scripts/functions-discover-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ IFS=$'\n\t'
# Globally link the CLI for the testing framework
./scripts/npm-link.sh

# Unlock internal commands for discovering functions in a project.
firebase experiments:enable internaltesting

for dir in ./scripts/functions-discover-tests/fixtures/*; do
(cd $dir && ./install.sh)
done
Expand Down
13 changes: 9 additions & 4 deletions scripts/functions-discover-tests/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ describe("Function discovery test", function (this) {
const cli = new CLIProcess("default", path.join(FIXTURES, tc.projectDir));

let output: any;
await cli.start("functions:discover", FIREBASE_PROJECT, ["--json"], (data: any) => {
output = JSON.parse(data);
return true;
});
await cli.start(
"internaltesting:functions:discover",
FIREBASE_PROJECT,
["--json"],
(data: any) => {
output = JSON.parse(data);
return true;
}
);
expect(output.status).to.equal("success");
for (const e of tc.expects) {
const endpoints = output.result?.[e.codebase]?.endpoints;
Expand Down

0 comments on commit cce0388

Please sign in to comment.